Answers for "git change commit author"

12

Change Git commit user name and author

# For one commit
git commit --amend --author="Author Name <[email protected]>"

# for multiple commits
git rebase -i B 
#if you need to edit A, use 
git rebase -i --root
#change the lines for both C and D from pick to edit
#Once the rebase started, it would first pause at C You would 
git commit --amend --author="Author Name <[email protected]>"
#Then 
git rebase --continue
#It would pause again at D
#Then you would 
git commit --amend --author="Author Name <[email protected]>" #again
git rebase --continue
#The rebase would complete.
#Use 
git push -f #to update your origin with the updated commits.
Posted by: Guest on November-27-2019
2

How to change git author

git commit --amend --author="Author Name <[email protected]>" --no-edit
Posted by: Guest on February-11-2021
1

git change commit author

git rebase -i HEAD~2
 git commit --amend --author="Cesar Bueno <[email protected]>"
 git rebase --continue
Posted by: Guest on August-30-2021
0

git change commit author for all commits

# Changes the username and email of all commits from the start.
git rebase -i --root -x "git commit --amend --author='YOUR_USERNAME <[email protected]> --no-edit'"
Posted by: Guest on August-05-2020
0

git change author of last 2 commits

git rebase -i YOUR_SHA -x "git commit --amend --author 'New Name <[email protected]>' -CHEAD"
Posted by: Guest on November-13-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language