feat(git): pull and accept forced updates without merging or rebasing

This commit is contained in:
Michele Cereda
2025-08-04 22:32:56 +02:00
parent 971be54b8a
commit 475e72983e

View File

@@ -132,3 +132,16 @@ git fetch 'upstream'
git checkout 'master'
git reset --hard 'upstream/master'
git push 'origin' 'master' --force
###
# Pull and accept forced updates without merging or rebasing
# ---------------------------------------------
# 1. download updates from the remote without trying to merge or rebase
# 2. [if needed] backup the current branch
# 3. reset the branch to the updates fetched just now
###
git fetch --all
git branch 'backup-main'
git reset --hard 'origin/main'