12

Using EGit with Eclipse when I try to push my code into the remote repository I get an error message saying that I should pull first, as shown in Figure 1.

Error dialog when trying to push

When I then try to pull from the remote repository I get a message saying that everything is up to date, as shown in Figure 2.

Message dialog after pulling

How do I fix this problem?

Marco Lackovic
  • 6,077
  • 7
  • 55
  • 56
  • 2
    Have you tried merging? – fcm Mar 18 '13 at 11:11
  • When I try using **Team / Merge..** and then selecting **origin/master** from **Remote Tracking** I get a _Multiple problems have occurred_ error dialog with the error message _Merge of revisions ... with base ... using strategy resolve resulted in: Failed._ – Marco Lackovic Mar 18 '13 at 11:16

2 Answers2

10

Make sure that:


The OP Krige adds:

in the end I noticed a class file was mentioned in the DIRTY_WORKTREE error message.
I deleted that file from the file system, did a pull, resolved the conflicts and pushed.
Everything seems to work fine now.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I am using Eclipse 3.8.0 installed on Ubuntu through its Software Center. I installed EGit using "Install New Software" inside Eclipse and the version I got is 1.3.0 – Marco Lackovic Mar 18 '13 at 12:00
  • @Krige 1.3 for Egit? Seems a bit old. – VonC Mar 18 '13 at 12:01
  • I didn't choose it, that's the one I got using "Install New Software" inside Eclipse – Marco Lackovic Mar 18 '13 at 12:04
  • 1
    @Krige but surely you can upgrade it? – VonC Mar 18 '13 at 12:04
  • It turned out I have used in Eclipse the wrong repository for EGit. I was using the Indigo main repository. I uninstalled EGit 1.3.0 and installed the newest version using the repository [link](http://download.eclipse.org/egit/updates). Now when I try to pull I get a dialog like in Figure 2, but now it gives me a `DIRTY_WORKTREE` message in the Failed Paths field. – Marco Lackovic Mar 18 '13 at 12:22
  • @Krige right, hence the advice to commit or stash everything *before* the pull. – VonC Mar 18 '13 at 12:24
  • I did the commit but I still get the `DIRTY_WORKTREE` error. I don't know what you mean with _stash_. The link to the thread in the second item of the list in your answer is broken. – Marco Lackovic Mar 18 '13 at 14:18
  • So in the end I noticed a class file was mentioned in the `DIRTY_WORKTREE` error message. I deleted that file from the file system, did a pull, resolved the conflicts and pushed. Everything seems to work fine now. – Marco Lackovic Mar 18 '13 at 16:46
  • @Krige Excellent, I have added your conclusion to the answer for more visibility. – VonC Mar 18 '13 at 16:51
2

If you have the DIRTY_WORKTREE issue and you are not able to delete the file (for whatever reasons), you should do a pull, or replace with HEAD and then add to Index. This will resolve the conflicts (assuming use of the merge tool) and you should then be able to commit/push your changes, or else pull again.

paulscott56
  • 496
  • 4
  • 7