Search code examples
gittortoisegit

TortoiseGit clone remote branch


I am trying to come to terms with Git as I recently started using it (long time Subversion user) and I cannot find a way to clone a remote branch with TortoiseGit.

I have created a local branch which I pushed to GitHub, but when I try to clone (checkout) this remote branch I cannot find any way to do it.

How can I do it?


Solution

  • As stated by linquize, this functionality isn't directly provided by TortoiseGit. If you really want to use it though, you can:

    • Clone the repository that the branch belongs to (right-click menu -> Git Clone...). This will also checkout the working copy created by clone to HEAD

    TortoiseGit clone window

    • Switch the working copy from HEAD to the desired branch/tag (right-click menu -> TortoiseGit -> Switch/Checkout)

    TortoiseGit switch window

    This will take a bit longer than from the command line, because the initial clone command implies a checkout to head, which you then have to switch back to the branch/tag you want.