当你不小心在master上改了代码,并且add, commit 之后,想push,发现根本push不了(本来也不能直接将master代码push到远端),而且每次pull远程master的时候都要和本地的master进行merge ,提示你需要push,烦得很!!
解决:git log 查看commitID ,尽量找早一点的,git reset --hard commitID ,再 git pull 就好了
常用命令:
- <<<<<<< main
-
- this is conflicted text from main
-
- =======
-
- this is conflicted text from feature branch
-
- >>>>>>> feature branch;
