amend a specific commit

Testy Termite answered on February 11, 2023 Popularity 9/10 Helpfulness 1/10

Contents


More Related Answers


amend a specific commit

0
Tip Testy Termite 1 GREPCC

For example, if your commit history is A-B-C-D-E-F with F as HEAD, and you want to change the author of C and D, then you would...

Specify git rebase -i B (here is an example of what you will see after executing the git rebase -i B command)

if you need to edit A, use git rebase -i --root

Change the lines for both C and D from pick to edit

Exit the editor (for vim, this would be pressing Esc and then typing :wq).

Once the rebase started, it would first pause at C

You would git commit --amend --author="Author Name "

Then git rebase --continue

It would pause again at D

Then you would git commit --amend --author="Author Name " again

git rebase --continue

The rebase would complete.

Use git push -f to update your origin with the updated commits.

Popularity 9/10 Helpfulness 1/10 Language whatever
Source: Grepper
Link to this answer
Share Copy Link
Contributed on Feb 11 2023
Testy Termite
0 Answers  Avg Quality 2/10


X

Sign in with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.