Search code examples
eclipsegitegit

Eclipse Egit. Checkout creates new commit. Why?


As I understand GIT, when I checkout on commit, I should get its files copy in my work directory, but no new commit should appear. Though when I use EGit and checkout on commit I see new commit in reflog. Why? As I understand checkout should not create new commit. Right?

Here I right click on commit and choose checkout

enter image description here

Then I get new commit in reflog:

enter image description here

So now I have few commits in my local master, but I never asked to do them.

Git integration for Eclipse - Task focused interface 4.6.1.201703071140-r org.eclipse.egit.mylyn.feature.group Eclipse EGit


Solution

  • You have to work with the History view instead of with the Git Reflog view (see git reflog and toniedzwiedz's answer for details):

    1. Tell the History view which history should be shown: e. g. in Git Repositories view right-click a repository and choose: Show In > History.
    2. In the History view enable the option Show All Branches and Tags (right button in the view toolbar). Otherwise, only commits of the current branch are displayed.