6

I do not want to clone the whole repository. We have a repository that is 300 MB, and I just only want the folder called /sourcecode, instead of downloading the whole root folder.

Is there a way to do this?

Yue Lin Ho
  • 2,945
  • 26
  • 36
user1929393
  • 4,089
  • 7
  • 30
  • 48

1 Answers1

2

The feature itself is not yet available for TortoiseGit: see issue 1599 (January 2013).

So it should be a simple checkout, except you need to edit first .git/info/sparse-checkout, as describe in "Is it possible to do a sparse checkout without checking out the whole repository first?".

Be aware that it is still buggy with msysgit1.8.1 though. See "Why does git sparse checkout leave behind directories?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • After editing the `.git/info/sparse-checkout`, can I just do `TortoiseGit->Pull...` and expect that it will sync only what's specified in `.git/info/sparse-checkout`? – Danijel Sep 26 '18 at 11:46
  • 1
    @Danijel Yes, provided you have set `git config core.sparsecheckout true`. see https://briancoyner.github.io/2013/06/05/git-sparse-checkout.html. See also https://stackoverflow.com/a/42626918/6309 – VonC Sep 26 '18 at 12:09