MSquared
MSquared

Reputation: 332

Eclipse Egit Not Updating Source Code on Switch

I am attempting to setup a new Eclipse environment to work on an existing project that is stored in BitBucket.

I am able to clone the BitBucket repository & checkout two branches (master & develop).

With the two branches in my local repository, I'm having the following issue: - Switch to develop - Change a file (e.g. ContentHandler.java) - Switch to master - There are no warnings about uncommitted changes being lost - The changes I made to the file are still visible after I've switched to Master

I had previously been able to use Eclipse & Egit on this project; however, I'm setting up a new dev machine and can't seem to get past the above issue.

Any suggestions on what I'm doing wrong?

FYI: - Used Egit "Clone Existing Repository" to clone the repo - Used File->Import->General->Existing Projects Into Workspace

Upvotes: 0

Views: 1037

Answers (1)

howlger
howlger

Reputation: 34137

If the HEAD revision of the modified file belongs to the same commit in both branches this is the expected behavior of Git (it is not Eclipse-specific and a feature, not a bug).

Only if an edited file has also to be changed due to switching branches, the edit has to be discarded, committed or stashed before switching.

See also Git allows for branch change with unstaged changes

Upvotes: 1

Related Questions