691 B
691 B
title, type, language, tags, author, cover, dateModified
| title | type | language | tags | author | cover | dateModified | |
|---|---|---|---|---|---|---|---|
| Update remote branch after rewriting history | snippet | git |
|
chalarangelo | compass | 2021-04-13T21:10:59+03:00 |
Forces an update of the remote branch after rewriting the history locally.
- Use
git push -fto force update the remote branch, overwriting it using the local branch's changes. - This operation is necessary anytime your local and remote repository diverge.
git push -f
git checkout patch-1
git pull
git rebase master
# Local `patch-1` branch has been rebased onto `master`, thus diverging
# from the remote `patch-1` branch
git push -f # Force update the remote `patch-1` branch