× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Git: Change Author Of Old Commits And Push It (Useful if you use multiple emails for git and forgot to switch to an account before a commit)

Mouna Cheikhna
Nov 20, 2016
<p>I often switch to another user or computer and forget to set git user<br> (specialy with github) only to remember it after pushing, to fix it :</p> <pre><code class="language-bash">$ git config user.name "My Name" $ git config user.email "my_email" $ git commit --amend --author "My Name &lt;my_email&gt;" $ git push origin my_branch --force</code></pre> <p><br>  </p>
comments powered by Disqus