TortoiseGit Clone Remote Branch

I am trying to come to an agreement with git since I recently started using it (a long time a disruptive user) and I cannot find a way to clone a remote branch with TortoiseGit.

I created a local branch that I clicked on github, but when I try to clone (checkout) this remote branch, I cannot find a way to do this

Any help?

thanks

+4
source share
5 answers

As pointed out by linquize, this feature is not directly provided by TortoiseGit. If you really want to use it, you can:

  • Clone the repository to which the branch belongs (right-click menu β†’ Git Clone ...). This will also check 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 little longer than from the command line, because the initial cloning command involves checking for the head, after which you need to switch back to the branch / tag you need.

+13
source

(This applies to TortoiseGit v1.8.3.0)

Make "Git -> Git Sync" first in the Tortoise context menu. (Note: you may need to shift down when you right-click, depending on how you installed Git Sync to appear in your context menu)

The "Remote Update" button will appear at the bottom below. Do this and it will pull all the new remote branches that are not in your local repository.

Remote update

After that, you can perform "Git β†’ Git Checkout" as usual, and the desired branch will appear in the list.

It should be noted that the same procedure can be used to inform TortoiseGit about new branches that were created in the remote repository, regardless of whether you were originally created or not.

+7
source

It is available in the Git clone window: enter image description here

+4
source

Unfortunately, the current TortoiseGit (TortoiseGit 1.7.13.0) cannot clone a specific branch. You can request a function request.

Work around:

  • Use a git statement, for example: git clone --recursive --branch 2.x-1.0
  • Use a different git GUI, for example. Smartgit

Another way is to clone all the branches and then delete the unwanted branches, even this is not a good solution, especially if you have many branches with many tags (and different file names), but for now this is a workaround until TortoiseGit provides it . I choose to clone the branch manually using the command line. This question was raised only by WINDOWS users because

+1
source

Update about this:

If you only need a specific branch, you can check it right now, for the time being. Copy the URL of the branch branch, i.e. https://github.com/USERNAME/REPONAME/tree/BRANCHNAME and replace tree with branches so you get https://github.com/USERNAME/REPONAME/branches/BRANCHNAME .

This URL can be used to check for a particular branch.

0
source

Source: https://habr.com/ru/post/1437590/


All Articles