1

I have a big repository with more than 300,000 commits. I wanna work just with recent commits. So, I used the following command:

echo "" > .git/info/grafts

But it does not work, since after that I ran git log, again it returned all the commits. The NEW-ROOT-SHA1 that I passed is also on master branch.

  • Why are you using grafts? I'm not very familiar with that part of git, but a cursory googling suggests that the grafts feature is mostly useful for interoperating with other SCMs. You don't mention any other systems in your question, though... – Brian Nov 19 '14 at 17:25

1 Answers1

0

If you're planning on leaving the main repository alone and limiting your local clone to just a few commits, you could use the following command to get only the last 12 commits:

git clone [location] --depth 12

Brian
  • 3,850
  • 3
  • 21
  • 37