H.v.M.
H.v.M.

Reputation: 1633

Edit earlier unpushed commits in Eclipse

When making many changes to a file, I want the changes to be neatly divided into easily-comprehensible commits for my colleagues to review. For example, commit 1 might be to factor out repeated code into a separate method, then after I make commits 2 and 3 (but before I push) I see another place where the new method can be incorporated, and I'd like to put this change in commit 1. Is this possible? If necessary I could then manually update commits 2 and 3 to incorporate this change.

Upvotes: 0

Views: 144

Answers (1)

howlger
howlger

Reputation: 34135

You can use Interactive Rebase for that as follows:

  1. Make a new commit with the changes for commit 1
  2. In the History view right-click the commit before commit 1 and choose Interactive Rebase
  3. In the Interactive Rebase view move the new commit to commit 1 and squash both commits

Upvotes: 1

Related Questions