.git/info/g" /> .git/info/g" /> .git/info/g"/>

echo into grafts does not work

93 Views Asked by At

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.

1

There are 1 best solutions below

0
Brian On

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