Failed, DIRTY_WORKTREE in eclipse, how to solve it?

below steps may help

  1. delete non-versioned files git clean -df

  2. reset your local changes

    git fetch git reset --hard


Delete the affected files and try to pull again. Thereafter push your changes to the git.


I got the same error while trying to merge the code. Delete the respective file in either of the branches to merge DIRTY_WORKTREE FAILED


Assuming your working in a local branch, that is branched from a remote branch, and the merge conflict is occurring after you 'commit and push' upstream, merge to remote branch.

Try these 3 steps:

  1. Copy off the new changes from the specific file causing the merge issue.
  2. In Eclipse, Explorer pane, rt-click on the specific file causing the merge issue, and select replace with previous revision.
  3. Now perform a 'commit and push'
  4. Perform a merge to remote branch (no conflict should be observed).
  5. In Eclipse, rt-click on the specific file again, and select 'pull' - the file should now be in sync all the way through.
  6. Now add the new changes, save, commit and push, and merge to remote branch (not conflicts should be observed).

Tags:

Eclipse

Git