-
-
Save filoscoder/7a407be1fdbcf21c75f458c2841c6b96 to your computer and use it in GitHub Desktop.
Revisions
-
trey revised this gist
Mar 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ If you need to change the author for a commit older than the most recent, do a ` $ git rebase -i HEAD~2 ``` Then choose `e` or `edit` next to the appopriate commit, then when it asks you to amend, run the same command as you would for the most recent commit: ```bash $ git commit --amend --reset-author -
trey revised this gist
Mar 16, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Change the email address for a git commit. ```bash $ git commit --amend --author="Author Name <[email protected]>" ``` -
trey created this gist
Mar 16, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ ```bash $ git commit --amend --author="Author Name <[email protected]>" ``` or ```bash $ git commit --amend --reset-author ``` If you need to change the author for a commit older than the most recent, do a `git rebase -i`. For example, if you wanted to change the penultimate commit, you'd run: ```bash $ git rebase -i HEAD~2 ``` Then choose `e` or `edit` next to the appopriate commit, then when it asks you to ammend, run the same command as you would for the most recent commit: ```bash $ git commit --amend --reset-author ``` Then, to finish, you'd run: ```bash $ git rebase --continue ``` And you're done. Don't forget you'll have to `--force` push if you've already pushed those commits to your remote. [source](http://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git)