Nest all content into snippets

This commit is contained in:
Angelos Chalaris
2023-05-07 16:07:29 +03:00
parent 2ecadbada9
commit 6a45d2ec07
1240 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,28 @@
---
title: Update remote branch after rewriting history
type: snippet
language: git
tags: [branch]
author: chalarangelo
cover: compass
dateModified: 2021-04-13T21:10:59+03:00
---
Forces an update of the remote branch after rewriting the history locally.
- Use `git push -f` to force update the remote branch, overwriting it using the local branch's changes.
- This operation is necessary anytime your local and remote repository diverge.
```shell
git push -f
```
```shell
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
```