2

I am using EGit and am aware that Checkout (on the Git perspective) allows me to switch between branches already in my repository (see What is the difference between git clone and checkout? ). However there is also the option "Switch To". When I "Switch To" another branch, it appears to me that all of the files stay the same, but just the "branch label" at the top of the page changes. I am not viewing the code on the branch I have switched to, but am viewing the code from my previous branch.

So what is the purpose of "Switch To" in EGit and when would I use it?

Phil
  • 1,897
  • 4
  • 25
  • 48

1 Answers1

1

"Switch to" is described in the Egit manual as being the git checkout equivalent.

The only cases it would not change / update the working tree are:

  • you mistakenly chose the same branch as the current one
  • or those files were private (not tracked yet), in which case Git by default would keep them.
  • or the Eclipse working space somehow does not refer to the actual Git working tree.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for confirming that "Switch to" is the equivalent of checkout and the for the link to the manual. I started a new workspace and "Switch To" now works! Not sure what was going wrong in my previous attempts but its resolved now. – Phil Jun 04 '18 at 08:40