Use Ctrl+G
to navigate to a line in the editor.
Use Ctrl+F12
to navigate the code base.
git commit
git commit --amend
use this to amend the last commit.
git commit --amend --author="Author Name <email@address.com>"
to change the author.
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
if you need to edit A, usegit rebase -i --root
- Change the lines for both
C
andD
from pick to edit - Once the rebase starts, it would first pause at
C
- You would
git commit --amend --author="Author Name <email@address.com>
- Then
git rebase --continue
- It will pause at
D
- Then you would
git commit --amend --author="Author Name <email@address.com>
again git rebase --continue
- The rebase would complete
git push -f
to update your origin with the updated commits