Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't commit files with Eclipse EGit

Tags:

eclipse

egit

Whenever I try to commit a file EGit says "no files to commit", though the file is staged for commit according to its icon in Project Explorer (see the image)

enter image description here

This happens to any file in my project. What am I doing wrong? I'm using EGit 0.11.1.

EDIT:

Updated to 1.2.0 and it worked, thank you all!

like image 730
szx Avatar asked Jul 04 '26 12:07

szx


1 Answers

As mentioned by the OP asd, EGit0.11.1 is not the latest version:
The Egit 1.2-SNAPSHOT (available through the nightly update site) solves the problem.

In general EGit promises to support at least the latest two Eclipse releases (as of this writing in Oct 2011 this is 3.6.2 "Helios SR2" and 3.7.1 "Indigo SR1").


For reference, my original answer was:

It is possible, as shown in bug 341679 to checkout a remote branch (or a tag), without creating a local branch.
If you are in this situation, then you are working in a detached HEAD, which would explain the "no files to commit" message.

See "Git Lesson: Be mindful of a detached head" for more, and check if your history doesn't display a HEAD pointer:

no head

The good news is that you can quickly fix this problem by creating a new branch.
In egit, this is as simple as Team -> Switch To -> New Branch. Now, all these ‘detached commits’ will live on the new branch (new_idea).

new branch

like image 122
VonC Avatar answered Jul 07 '26 05:07

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!