-2

I need to over-write/update Author in my entire master branch git repo.

I know I can do this one by one

git commit --amend --author="John Doe <jdoe@outlook.com>" --no-edit git push -f

but that will take me weeks.

Is there a faster way to update all the commits Author in the master branch?

code-8
  • 54,650
  • 106
  • 352
  • 604
  • 2
    There's a *less fast* way to do it (see filter-branch), in a way, since the proposed way (through --amend) is not only time-consuming, it won't work. – Romain Valeri Oct 21 '19 at 15:08
  • Please read [ask] and show what you have tried. – CodeCaster Oct 21 '19 at 15:09
  • 1
    [Could I change my name and surname in all previous commits?](https://stackoverflow.com/questions/4493936/could-i-change-my-name-and-surname-in-all-previous-commits) – CodeCaster Oct 21 '19 at 15:10
  • The purpose of `git filter-branch` is to apply an operation to each commit in a given branch. – chepner Oct 21 '19 at 15:21

1 Answers1

-4

You can write a shell script to for-in all the commits and push them back, like.

for commits in $(git log --pretty=format:"%h")
do
  git commit --amend....
done

If that does not work, like others are suggesting it may not, try referring official article, https://help.github.com/en/github/using-git/changing-author-info

Nitesh Kumar Anand
  • 621
  • 1
  • 6
  • 18