Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the pushing rejected and asked to pull when pulling results in "everything is up to date"?

Tags:

git

eclipse

egit

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?

like image 469
Marco Lackovic Avatar asked Mar 18 '13 11:03

Marco Lackovic


People also ask

How do you push changes to commit?

To push changes from the current branch press Ctrl+Shift+K or choose Git | Push from the main menu. To push changes from any local branch that has a remote, select this branch in the Branches popup and choose Push from the list of actions.

What is git push origin?

Git Push Origin pushes all the branches to the main branch. Git Push Origin Master pushes your master branch to the origin. Command for this: git push origin.


2 Answers

Make sure that:

  • you are using the latest version of EGit (2.3+)
  • you have stashed/commit everything before pulling (as in this thread)
  • you are not in a detached head mode (as in "can't push upstream using EGit")

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.

like image 57
VonC Avatar answered Sep 22 '22 08:09

VonC


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.

like image 2
paulscott56 Avatar answered Sep 21 '22 08:09

paulscott56