Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rewinding remote git branch [duplicate]

Possible Duplicates:
How do I push amended commit to the remote git repo?
Undoing a git push

Hi,

I've deleted some commits from my master branch by using

git reset --hard SHA_VALUE

I have, however a remote version of the repository on github, and whenever I git push things, I get an error message, that I should merge the changes contained in the remote repository (which I do not want to).

So my question is, what is the remote equivalent to the git reset command?

thx

like image 454
mvaz Avatar asked Feb 16 '10 09:02

mvaz


2 Answers

You can use "git push" with "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.
like image 121
silvio Avatar answered Oct 16 '22 16:10

silvio


I think you need to do a "git rebase". Check this article on rebasing and read the section titled "Common Rebasing Use Practices".

like image 44
ardsrk Avatar answered Oct 16 '22 16:10

ardsrk