EGit continually disallows me to switch away from branch [message #1797873] |
Wed, 07 November 2018 15:45  |
Eclipse User |
|
|
|
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 #1797880 is a reply to message #1797874] |
Wed, 07 November 2018 18:04  |
Eclipse User |
|
|
|
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/
|
|
|
Powered by
FUDForum. Page generated in 0.03449 seconds