Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial git commit from eclipse (egit)

Tags:

git

eclipse

egit

Say I have a file with 2 changes. How do I use egit to commit only one of them?

The command line version can be found in this question.

like image 320
Malt Avatar asked Aug 14 '14 09:08

Malt


People also ask

What is EGit in Eclipse?

EGit is an Eclipse Team provider for the Git version control system. Git is a distributed SCM, which means every developer has a full copy of all history of every revision of the code, making queries against the history very fast and versatile.

How do you commit unstaged changes in Eclipse?

Open one of your files, make a change, and you should see it appear in the Git Staging view in the Unstaged Changes window. Drag it into the Staged Changes area, add a commit message, and click Commit. You can also use the Team menu; right-click on the file, choose Team -> Add to Index, then Commit.

How do I fix rejected non fast forward in Eclipse?

If you do a commit in one project and then accidentally push this commit, with bypassing code review, to another project, this will fail with the error message 'non-fast forward'. To fix the problem you should check the push specification and verify that you are pushing the commit to the correct project.

How do I tag a commit in Eclipse?

In the project tree right click on Tags -> Create Tag. Enter tag name and tag message.


1 Answers

You can also follow "Git Partial Staging in Eclipse"

From the staging view, double-click on the file. A compare dialog will appear.

  • On the left are your current changes;
  • on the right is the currently staged work.

You can now copy changes from the left to the right, effectively staging parts of your file. In this case I will stage the correction to the method name.

http://eclipsesource.com/blogs/wp-content/uploads/2014/06/Screen-Shot-2014-06-02-at-11.11.26-PM.png

like image 171
VonC Avatar answered Sep 22 '22 20:09

VonC