Git commit not possible. There are no staged files

Simon Kiely picture Simon Kiely · Jul 27, 2016 · Viewed 50.2k times · Source

I am using EGits with Eclipse and running into some issues.

I have one change from head; I have made one new class.

When I right click on this class and click "push", the following dialog shows and I cannot get past it :

Dialog box with "Committing is not posssible. There are no staged files".

Anyway, I need to push this file because I can't commit in real life, and now I cannot commit in Eclipse either and it's taking it's toll mentally.

Thanks.

PS I have googled this extensively looking for an easy fix (like a "stage" button) and found nothing.

Answer

Anil Kumar picture Anil Kumar · Jul 27, 2016

using EGit: Right click it and navigate to Team => Add.

after then Push the code

Before pushing the file add that new file on git using terminal

git add after then

git push origin branch