⚠️ ARCHIVED WEBSITE, NO FURTHER UPDATES ⚠️

Daily Shaarli

All links of one day in a single page.

February 20, 2021

Change the user of all commits in a git repository and GPG sign them with your key

I was stupid enough to commit a lot of stuff without changing the git configuration, so I needed to change the author of ALL commits in the repository:

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Newname'; GIT_AUTHOR_EMAIL='new@email'; GIT_COMMITTER_NAME='Newname'; GIT_COMMITTER_EMAIL='new@email';" HEAD

After that, sign all commits, change the [ref] to from where you want to start, in my case, it was the first commit hash:

git rebase --exec 'git commit --amend --no-edit -n -S' -i [ref]

Based on here, and here