Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cd /tmp
- dir=$(mktemp -d)
- cd $dir
- git init
- git commit --allow-empty -mInit
- git commit --allow-empty -ma
- git commit --allow-empty -mb
- git commit --allow-empty -mc
- cd ..
- dir_remote=$(mktemp -d)
- cd $dir_remote
- git init
- git config receive.denyCurrentBranch ignore
- cd $dir
- git remote add origin $dir_remote
- git push origin main
- # Two notes in the “local” repo
- git notes add -mc
- git notes add -mb @~
- # And one note in the “remote” repo
- cd $dir_remote
- git notes add -ma @~~
- cd $dir
- git fetch origin refs/notes/commits:refs/notes/origin/commits
- # Backup before merge
- git tag before-merge refs/notes/commits
- git notes merge -v origin/commits
- # Undo merge
- git update-ref refs/notes/commits before-merge
- # Do rebase instead
- git switch --detach notes/commits
- git rebase notes/origin/commits
- git update-ref refs/notes/commits @
- git switch -q -
- git tag --delete before-merge
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement