17

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.

Community
  • 1
  • 1
Malt
  • 28,965
  • 9
  • 65
  • 105
  • 2
    The egit documentation says [this](http://wiki.eclipse.org/EGit/User_Guide#Partial_Staging) - does that work for you? – Useless Aug 14 '14 at 09:36

1 Answers1

28

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

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Huge thankyou! This will save me huge amounts of time. – null May 26 '17 at 06:22
  • 2
    Just in case anyone misses out on this (not that I did and wondered for quite some time why it does not work): Press Ctrl+S (or whatever your hotkey is) to save the changes... Saving will not affect your current file you work on, but just the changeset. – user136036 Aug 31 '20 at 16:55