我试图取消所有提交由詹姆斯推加让我的地方他提交并返回到提交由布兰登是推
d65fa2faf06a5c4d8d379f963feece2bf2edef98.
我想这样做
git revert a586cc1ff0c5abf535a4d0873c458a812dca28dd..1dcc0e8adc5433a5b092e3b813496ac52de7aa43
- 但对于一些未知的原因,它抛出我这个错误
hint: Waiting for your editor to close the file... error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.
并在年底只恢复1dcc0e8adc5433a5b092e3b813496ac52de7aa43
这里是我的开发分支的git的日志
commit 1dcc0e8adc5433a5b092e3b813496ac52de7aa43 (origin/develop, feat_SS_250.fixes)
Author: <[email protected]>
Date: Tue Feb 5 17:50:20 2019 +0900
schema added
commit fee01a2dcf3432b7da6e9e6b1ff030ad288d919d
Author: <[email protected]>
Date: Tue Feb 5 17:48:49 2019 +0900
rebase
commit 7f226d84029e608721417b8e99be1a88c6ae3a84
Author: <[email protected]>
Date: Tue Feb 5 16:03:07 2019 +0900
initial commit
commit a586cc1ff0c5abf535a4d0873c458a812dca28dd
Author: <[email protected]>
Date: Thu Jan 24 11:42:08 2019 +0900
added login.php
commit d65fa2faf06a5c4d8d379f963feece2bf2edef98
Author: brandon <[email protected]>
Date: Tue Feb 5 14:52:04 2019 +0900
feat: fp 50
commit 9988b6587f9e2fa77d86e9e1f856bf57e667daca
Author: brandon <[email protected]>
Date: Tue Feb 5 14:25:51 2019 +0900
feat: contract 50
您可以 ...
git reset --hard d65fa2f
git push -f origin develop
注:建议你把你的远程备份force
推动任何更改之前。另外,如果有人已经退出其中有詹姆斯变更所在的分支,他们是受收到错误,下一次他们试图pull
分支。
在我的情况,可能是我想这样做:
(01)重置号最后提交,并保持提交的上演:
$ git reset --soft HEAD~<num_of_commit_from_HEAD>
$ git status
$ git log
$ git push -f origin <branch_name>
在这里,你的情况num_of_commit_from_HEAD
= 4
和branch_name
= develop
。
(02)复位一些最后的提交和删除提交:
$ git reset --hard HEAD~<num_of_commit_from_HEAD>
$ git status
$ git log
$ git push -f origin <branch_name>
在这里,你的情况num_of_commit_from_HEAD
= 4
和branch_name
= develop
。