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?
Go to the current directory where you want the cloned directory to be added. To do this, input cd and add your folder location. You can add the folder location by dragging the folder to Git bash. Click on “Clone or download” and copy the URL.
To clone git repository into a specific folder, you can use -C <path> parameter, e.g. Although it'll still create a whatever folder on top of it, so to clone the content of the repository into current directory, use the following syntax: cd /httpdocs git clone [email protected]:whatever .
To clone a repository you have to run the clone dialog. From the explorer context menu select TortoiseHg… ‣ Clone a repository or type thg clone. It is the path (or URL) of the repository that will be cloned. Use the Browse… to choose a local folder.
Clone to a FolderBy default, a folder is created with the same name as the repository we cloned. In our first example, we cloned a repository without specifying a folder name.
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?".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With