This can cause the remote repository to lose commits; use it with care.
If you do not wish to merge the remote branch into your local branch (see differences with git diff), and want to do a force push, use the push command with -f
git push -f origin <branch>
where origin
is the name of your remote repo.
Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This flag disables the check. This can cause the remote repository to lose commits; use it with care.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…