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

clonegit

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

Best Answer

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