Force Pushing

suggest change

Sometimes the remote branch cannot fast-forward to your local branch (it is not an ancestor of your tip). A normal push is rejected. A force push still updates the remote.

git push -f

or

git push --force

Important notes

This will overwrite any remote changes and your remote will match your local.

Attention: Using this command may cause the remote repository to lose commits. Moreover, it is strongly advised against doing a force push if you are sharing this remote repository with others, since their history will retain every overwritten commit, thus rendering their history out of sync with the remote repository.

As a rule of thumb, only force push when:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents