Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » EGit continually disallows me to switch away from branch
EGit continually disallows me to switch away from branch [message #1797873] Wed, 07 November 2018 20:45 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Version: 2018-09 (4.9.0)
Build id: 20180917-1800

I was doing work on a pull request branch of a project. I discovered I had to make a change directly in the master branch, so I selected "Switch to" and selected "master". It then presented a "Checkout conflicts" dialog, saying "the files shown below have uncommitted changes ...". There's only a "index.ts" file in the list. So, I then click "Reset". I see "Resetting to HEAD" in the status line for a few seconds. Then, the same "Checkout conflicts" dialog reappears, listing the same file. I select "Reset". Same result.

I then tried a similar action, by simply right-clicking on the repository in question and selecting "Reset..." with "Hard" selected. I let the process complete. While this was running, I had the staging view visible, and even after the reset operation completed, I could still see the "index.ts" file in the "Unstaged changes" list, with a "?" next to it.

How do I get out of this loop?
Re: EGit continually disallows me to switch away from branch [message #1797874 is a reply to message #1797873] Wed, 07 November 2018 20:51 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I was able to get out of this by simply going to the filesystem and manually removing that index.ts file. I'd still like to understand why a hard reset didn't fix this.
Re: EGit continually disallows me to switch away from branch [message #1797880 is a reply to message #1797874] Wed, 07 November 2018 23:04 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
The ? decorator is shown for untracked files which aren't versioned in git (yet).
Hence it doesn't change status when you run git reset command which only affects files tracked by git.

The checkout conflict may happen if e.g. in the current branch this file isn't tracked by git but is present
in the working tree as unversioned file. If the branch you try to checkout contains this same file with
different content checking this out would overwrite the content of the non-versioned file in the working tree
Hence git raises a checkout conflict so that you have a chance to save this content somewhere before doing
the actual checkout. Native git has a -f flag to forcefully do the checkout overwriting the local unversioned file.

A corresponding feature for jgit is currently in review here [1].

[1] https://git.eclipse.org/r/#/c/117181/
Previous Topic:Feature ideas - post in Bugzilla?
Next Topic:eGit in oxygen unable to find existing local repositories
Goto Forum:
  


Current Time: Tue Apr 23 11:50:22 GMT 2024

Powered by FUDForum. Page generated in 0.03290 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top