Add retroactive signing to git.md

This commit is contained in:
2021-09-01 13:22:35 +01:00
parent 6872e0e4e0
commit a2aff0171e

18
git.md
View File

@@ -8,7 +8,7 @@ tags: [ linux, programming, git ]
# Fix detached head
From https://stackoverflow.com/a/10229202 :
From <https://stackoverflow.com/a/10229202>:
## To Delete Changes
@@ -24,3 +24,19 @@ git checkout main
git pull . temp
git branch -D temp
```
# Retroactively Sign Commits
From <https://webdevstudios.com/2020/05/26/retroactively-sign-git-commits/>:
1.
```
git rebase -i HEAD~<number of commits to sign>
```
2. Replace `pick` with `reword`:
In vim: `:%s/^pick/reword/:wq`
3. Save all commit messages
4. Force push to remote