Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switch branches with tortoisegit

I cloned a git respository on my hard disc. This git repository contains not only the master but also a branch called newBranch. How can I checkout the new branch with tortoisegit?

I tried it with the switch/checkout command but nothing changed in my local files. What works is when I clone the two branches in different folders like but I want to get it working with tortoisegit.

git clone localhost:testProject

differs from

git clone localhost:testProject newBranch

like image 495
Sebastian Müller Avatar asked Nov 17 '10 12:11

Sebastian Müller


3 Answers

You have a checkbox option Force when switching branches in TortoiseGit.
Other than that, I must admit I'm stumped to.

like image 200
Lieven Keersmaekers Avatar answered Sep 25 '22 12:09

Lieven Keersmaekers


This is what worked for me:

  • Right click base folder and choose "Git Clone...".
  • In the popup, give the Git repository path, choose appropriate local folder
  • select the Branch option and type-in your branch name. Click Ok.
like image 24
Sija Avatar answered Sep 24 '22 12:09

Sija


Go to settings from the context menu. General->Context Menu->Select 'Switch/Checkout'.

Afterwards it will be visible in the context menu.

like image 36
aep Avatar answered Sep 24 '22 12:09

aep