Git change branch force

broken image
broken image

Also, even if no one else has pushed anything to the remote repository in the meantime, your colleagues might still have based their new work on the old commit history.

broken image

This is a rather dangerous process, because it's very easy to overwrite (and thereby lose) commits from your colleagues. The -force option for git push allows you to override this rule: the commit history on the remote will be forcefully overwritten with your own local history. Only when you are up-to-date will you be able to push your own new commits to the remote.

broken image

As described above, Git will normally only allow you to push your changes if you have previously updated your local branch with the latest commits from its remote counterpart.

broken image