Eclipse EGit Checkout conflict with files: - EGit doesn't want to continue

前端 未结 9 1514
旧时难觅i
旧时难觅i 2021-01-30 09:02

I\'ve started Eclipse EGit. In some scenarios it is really not comprehensive.

I have local file e.g. pom.xml changed. On git server this file was changed. I do pu

相关标签:
9条回答
  • 2021-01-30 09:10

    If error comes for ".settings/language.settings.xml" or any such file you don't need to git.

    1. Team -> Commit -> Staged filelist, check if unwanted file exists, -> Right click on each-> remove from index.
    2. From UnStaged filelist, check if unwanted file exists, -> Right click on each-> Ignore.

    Now if Staged file list empty, and Unstaged file list all files are marked as Ignored. You can pull. Otherwise, follow other answers.

    0 讨论(0)
  • 2021-01-30 09:15

    Situation:

    • You have local uncommitted changes
    • You pull from the master repo
    • You get the error "Checkout conflict with files: xy"

    Solution:

    • Stage and commit (at least) the files xy
    • Pull again
    • If automerge is possible, everything is ok.
    • If not, the pull merges the files and inserts the merge-conflict markers (<<<<<<, >>>>)
      • Manually edit the conflicting files
    • Commit and push
    0 讨论(0)
  • 2021-01-30 09:20

    This is the way I solved my problem:

    1. Right click the folder that has uncommitted changes on your local
    2. Click Team > Advanced > Assume Unchanged
    3. Pull from master.

    UPDATE:

    As Hugo Zuleta rightly pointed out, you should be careful while applying this. He says that it might end up saying the branch is up to date, but the changes aren't shown, resulting in desync from the branch.

    0 讨论(0)
  • 2021-01-30 09:21

    Right click on the project and select [replace with] -> Head Revision .Now select pull changes in current branch or pull changes from upstream.

    0 讨论(0)
  • 2021-01-30 09:22

    After you get from Eclipse the ugly CheckoutConflictException, the Eclipse-Merge Tool button is disabled.

    Git need alle your files added to the Index for enable Merging.

    So, to merge your Changes and commit them you need to add your files first to the index "Add to Index" and "Commit" them without "Push". Then you should see one pending pull and one pending push request in Eclipse. You see that in one up arrow and one down arrow.

    If all conflict Files are in the commit, you can "pull" again. Then you will see something like:

    \< < < < < < < HEAD Server Version \======= Local Version > > > > > > > branch 'master' of ....git

    Then you either change it by the Merge-Tool, which is now enable or just do the merge by hand direct in the file. In the last step, you have to add the modified files again to the index and "Commit and Push" them.

    Checking done!

    0 讨论(0)
  • I guess the best way to do this is like this :

    1. Store all your changes in a separate branch.
    2. Then do a hard reset on the local master.
    3. Then merge back your changes from the locally created branch
    4. Then commit and push your changes.

    That how I resolve mine, whenever it happens.

    0 讨论(0)
提交回复
热议问题