Changing the git branch on eclipse

eclipse, git, spring-tool-suite

Solution

Actually, I don't think you even need to refresh the project. That is, assuming you have 'eGit' installed and your projects are already configure as git projects (they should be, because in most cases, egit does that automatically).

Whenever you run git commands on the shell (outside eclipse) egit will automatically refresh projects for you and update their status when you switch back to Eclipse.

If you are not using egit then yes, you have to refresh the projects manually, but that is all you'd have to do since running the 'git checkout my-branch' command in the shell already changed the files on disk to be those from 'my-branch'.

Problem

This is the first time I do this. I imported a git project in eclipse. Then I used the shell to create another branch and checkout to the new branch. Is refreshing the imported project in Eclipse enough to tell Eclipse that we are working on the new created branch? thanks

Original source