How to convert a Git shallow clone to a full clone?

Mot picture Mot · Jul 23, 2011 · Viewed 75k times · Source

Follow-up of this so-question: if I have a shallow clone, how to fetch all older commits to make it a full clone?

Answer

Ramkumar D picture Ramkumar D · Jul 30, 2013

The below command (git version 1.8.3) will convert the shallow clone to regular one

git fetch --unshallow

Then, to get access to all the branches on origin (thanks @Peter in the comments)

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin