Fetch more depth in a shallow git clone

Posted: 6th May 2015 by Tim in Git
Tags: , , , ,

If you’ve made a shallow clone of a repository but suddenly find yourself needing more history, you can fetch this history using one of these two commands:

All history:
git fetch --unshallow

Only the last 123 updates:
git fetch --depth=123

For the second command, 123 can be replaced with any number. If the depth requested is larger than the history of the repository, all records will be fetched.