Better support for shallow clones in Git 1.9

If you add the parameter “–depth ” when using “git clone”, this will cause what is described in  documentation of git clone as follows:

Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.

The good news is, that Git 1.9 will improve the support of shallow clones by removing the limitations described above. E.g., you will be able to push from a shallow cloned repository to another repository.

As this feature used to have big limitations, I never had a use-case for it in my daily work. Using Git 1.9 this could really be helpful when working with repositorys having a big amount of commits. The only question I can’t answer at this point of time is if EGit/JGit are able to work with shallow clones (this could be a no-go for me).

Short URL for this post:
This entry was posted in Build, config and deploy and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *