Zuenonentu Zuenonentu - 3 months ago 15
Git Question

Eclipse neon "no staged files" error

I am using Eclipse Neon for Github, to be able to push changes.

I already have a Github account and made a specific repository just for trying, but nothing ends up in the repository, though I follow guides and do exactly the same without getting any errors, but ending up with an empty Github repository (except for the Readme file that I created along with the repository at the website).

I've made several Java Projects with a simple

main
method, and a method for just writing a dummy message, simple, but doesn't exist in repository.

Then I right click the project, select Team -> Share Project and select:

Repository: NewGit - /home/jannik/NewGit.git, working tree: /home/jannik/NewGit and Path within repository: dummy and click my dummy project and press finish.

Now I right click my project again and choose Remote -> Push and choose the default option called Configured remote repository which says origin: https://github.com/< my-github-account>/eclipseTest.git which tells me that it links to my repository named eclipseTest (which I made on website).

I then press Next and press *Add all Branches spec and clicks next, and then Finish. I then get a dialog saying that Master and NewGit branches are up-to-date, though my dummy project is missing.

If I try the Commit option in Eclipse, I get an error saying that there're no staged files

What am I doing wrong?

Answer

Before being able to push anywhere, you need to add and commit first.

See "EGit/User Guide/Commit" for adding and committing.

Its Track Changes sections shows how to add files to the index.

Click Team > Add to Index on the project node. (This menu item is named Add on older versions of Egit.)

Then:

Click Team > Commit in the project context menu.

Finally, you can push.