Rewind remote git branch

Possible duplicates:
How can I push a fixed commit to a remote git repository?

Cancel git push

Hi,

I removed some commits from my main branch using

git reset --hard SHA_VALUE

I have, however, a remote version of the github repository, and whenever git pushI get things, I get an error that I have to merge the changes contained in the remote repository (which I don't want).

So my question is: what is the remote equivalent of a command git reset?

THX

+3
source share
2 answers

You can use git push with the force option

git push -f

via manpages:

   -f, --force
       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.
+4
source

, "git rebase". " ".

0

Source: https://habr.com/ru/post/1732974/


All Articles