Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to easily Git commit in Eclipse Neon

Tags:

java

git

eclipse

I just upgraded to Eclipse Neon from Mars. Earlier I could just select "Commit" from the "Team" menu, and the dialog would provide checkboxes for the files I wanted to stage. I could easily hit "select all" and all files would be staged. In fact, the files already in the repository would already be checked, if I remember correctly.

Now Eclipse Neon doesn't pop up a dialog, but shows a "Git Staging" view tab. The modified files are listed as "Unstaged Changes". Yes, I'm familiar with the Git workflow, but this seems a step backwards for the Eclipse UI. How do I "stage" the file? Do I have to select them and drag-and-drop them to "Staged Changes"? Do I have to right click on them and add them to the Index?

Whatever happens, it won't let me just hit the "Commit" button---it will complain that there are no unstaged files. Am I missing some way to commit that was as easy as it was in Eclipse Mars, with auto-staging of files or at least a "stage all" button?

like image 334
Garret Wilson Avatar asked Aug 10 '16 17:08

Garret Wilson


2 Answers

Select YourProject --> Team --> Commit..., A Git Staging console will open.

Now follow below steps for Commit or Commit and Push changes...

  1. There are two ways to add files in Staged Changes:

    • drag and drop the corresponding tree node to the staged changes pane. enter image description here
      • click "Add to Git Index" from the context menu. enter image description here
  2. Enter the commit message. enter image description here

  3. Click "Commit" or "Commit & Push"
like image 87
ArpitBora Avatar answered Oct 06 '22 09:10

ArpitBora


For the time being I'm disabling the Staging View in Windows > Preferences> Team > Git > Committing, opting to use the old-fashioned Commit Dialog (the one from Eclipse Mars) instead. I don't have time to muck around with extra listbox selections, mouse clicks, and context menu selections just to commit my code.

I hope someone else comes up with a better answer. The Git Staging View was interesting... but not if it slows me down.

like image 34
Garret Wilson Avatar answered Oct 06 '22 09:10

Garret Wilson