git reset is suitable for operations in your own branch. It is not recommended to perform this operation after the branch has been merged into the remote repository.
If the remote repository will not affect other people's update and merge (one person's remote repository), you can use git -f push to force push to the remote repository.
The concepts of history between svn and git are very different.
The push operation of git is equivalent to merging the current branch into the remote branch. The operation of braised cooking is actually like this
开始是这样: o--o--o--o--o
后来reset: o
再后来: o
\
x--x
So Luzhui wants to merge the completely different branches since the first commit. Do you think remote can agree? If you want to merge, Luzhui can be merged under the current branch, for example
Deleting the remote branch directly is too violent. You can refer to the solution in this blog http://blog.mtxcxin.cn/blog/How to roll back a remote warehouse in git.html
git reset is suitable for operations in your own branch. It is not recommended to perform this operation after the branch has been merged into the remote repository.
If the remote repository will not affect other people's update and merge (one person's remote repository), you can use git -f push to force push to the remote repository.
The concepts of history between svn and git are very different.
The push operation of git is equivalent to merging the current branch into the remote branch. The operation of braised cooking is actually like this So Luzhui wants to merge the completely different branches since the first commit. Do you think remote can agree? If you want to merge, Luzhui can be merged under the current branch, for example
Or replace the remote branch with a local branch
It is recommended to read the book "Pro Git" in detail, it will be very helpful.
English: http://git-scm.com/book/Chinese: http://git-scm.com/book/zh
Use git push -f or git revert, see for details:
git push -f
Deleting the remote branch directly is too violent. You can refer to the solution in this blog http://blog.mtxcxin.cn/blog/How to roll back a remote warehouse in git.html