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

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.
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.
How do I fix this problem?

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.

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.

Related

STS getting this while pull/fetch latest changes Couldn't lock local tracking ref for update

Getting this issue in spring tool suit while fetching/pull latest changes from remote branch. i don't have git bash on my local previously it was working fine right now i am getting below mention issue.
Couldn't lock local tracking ref for update
I also encountered same problem
But I removed this problem using GITHUB Desktop tool.
Once I executed pull from STS, its showed the dialog box with error as shown above. and a up arrow got appended showing there are some commit to be pushed,
though I had not made any commits before this pull. The changes from pull were not added to my local project.
I checked on Github Desktop, and it also showed same arrow.
I pushed it from tool, and it was resolved. The changes from pull got added to local project.
While you don't have git bash, Eclipse is using its own JGit (java-based implementation of Git)
As recommended in "egit lock fail eclipse", do check if you have any "<refname>.lock" file under .git/refs/". (howlger refers to eclipse issue 417860:
I checked in jgit and egit sources and found that the only occurrence of the text "[lock fail]" is used when fetch fails to update a remote tracking branch.
This can happen if a previous crash didn't cleanup a "<refname>.lock" file which git creates as a lock to guard the ref against concurrent updates.
git remote prune origin
solved same problem for me

GitHub client cannot sync after changes made to some files

I have a git repository in which I work in collaboration with some people but I cannot sync anymore. I am using the GitHub Windows client application on Windows 7:
Last time I synced, the operation succeeded and I ended up with a perfect copy of the latest code.
Next, I made some simple changes to a few files, but did not commit anything yet.
In the meantime, someone else made changes to some other files.
In order to see the changes of the repository, I'm trying to sync again.
GitHub client reports "Sync failed".
Now I am wondering if this is normal behavior or if there is something wrong with my repository ? Shouldn't I be able to sync the repository and get latest files even though I am making some changes that are still not committed ?
Thanks.
When you got this kind of error just try to open a git shell and type git status into your working directory. You will have some infos that could help you like which files are in conflict.
It must be one of the other collaborators that updated and pushed a file you just updated. If so, you will have to choose which version you want to keep in your local files.

GitKraken: Unable to commit files and merge branches

I am unable to commit files in GitKraken after staging as the "Commit" button just doesn't respond. Also, whenever I try to merge a branch (most cases it's master) I get an error saying "Signature Author Required". Yet, I am able to do everything in the command line. I've attempted to reach out to Axosoft but since I'm using the free version it seems unlikely that I'll get any response. I've also tried uninstalling and re-installing the program but to no avail. Thank you in advance for the help.

Github DETACHED HEAD error when working with another developer

A developer and I were working on using .gitignore to add some conditions to the C# projects and solutions we were committing, since he previously encountered an issue of being unable to commit as a result of us committing binaries (such as .suo) to Github as well, which caused conflicts.
We fixed that issue of the .gitignore, now it ignores a number of conditions. However, when I went back to my computer, I am currently getting the DETACHED HEAD error. I did a git status, and the command line has been giving me these messages.
I am unsure how to solve this issue. I was wondering what I can/should do so I can go back to Master and commit/sync my changes?
Also, how do I prevent this issue in the future?
http://puu.sh/6EY9d/ae25db08b9.png
I was in rebase, so I ran git rebase --abort to get out of that.
Afterwards I was back in master, which allowed me to commit again.

"An internal error occurred" when trying to commit to git from eGit in Eclipse

[SOLVED] Somehow, I managed to not have "write" permissions to the .git directory. So was trying to write the commit and getting bounced.
I've been using Eclipse for a few months, but had been just running git from the CLI. I decided that was inefficient and that I wanted to use eGit, so I started following this tutorial (http://www.slideshare.net/loianeg/using-the-egit-eclipse-plugin-with-git-hub-2578587?from=embed).
I'm trying to add an existing project, so I did Team-->Share Project-->Git and selected the .git corresponding to my project. Eclipse seems to have picked it up, okay, but when I try to commit, I get a popup saying
"Committing changes has encountered a problem' -- an internal error occured.
When I click details, it say "An internal error occurred
Exception caught during execution of commit command"
...I don't even know where to start on this one. I googled the error and didn't get anything useful.
Anyone know how to fix this, or at least how to start debugging?
I've solved my case removing index.lock file from the git folder of the project.
start debugging?
Check the "Errors" Eclipse view for a full Stack Trace associate with that error message
Example of an Error View:
fix it?
If the Exception is a NPE one (NullPointerException), like shown in bug 329611, then you can try a git commit -m "a message" in a shell, in order to get past that initial first commit with a GUI.
As the OP rogueleaderr mentions, the error view and the exact stack trace behind the exception was enough:
Somehow, I managed to not have "write" permissions to the .git directory.
So was trying to write the commit and getting bounced.
I face this problem too, Error tab doesn't show anything more.
So I use GitExtension to commit instead, problem solved.
Using parallel eGit and GitExtension to keep tracking a local git repo is a good idea. It's update runtime on both Eclipse and GitExtension when we make change on each.
I faced this problem. I delete the .git folder and .gitignore file push to upstream it works correctly.
I had this same issue. I resolved it by committing manually from terminal using (in this order):
git add . then git commit and lastly, git push from the local repo directory.
I faced similar problem, It was resolved after deleting index.lock file in .git\ folder.