我是一个使用git的项目中唯一的成员,完成了一些提交、合并和推送到远程仓库的操作,但这些操作顺序不当。现在我想重新组织所有变更(只有1个主分支,1个用户),通过变基(rebase)方式压缩(squash)和重命名(rename)一些提交。
我试图使用此链接中建议的命令进行操作:How to squash commits in git after they have been pushed?,但是我遇到了一些错误,而且无法理解。以下是显示问题的屏幕截图:
我试图使用此链接中建议的命令进行操作:How to squash commits in git after they have been pushed?,但是我遇到了一些错误,而且无法理解。以下是显示问题的屏幕截图:
===========================ERROR AS TEXT================================
使用的命令:
git rebase -i origin/master~2 master
(应该只显示2个提交,但不知何故它显示了超过2个,如40+)
错误信息:
interactive rebase in progress; onto 9bdd944
Last commands done (15 commands done):
pick 7af3656 "commit message"
pick 7355eff "another commit message"
Next commands to do (110 remaining commands):
pick fc10330 "another commit message"
pick f22d8c0 "another commit message"
You are currently rebasing branch 'master' on '9bdd944'.
nothing to commit, working tree clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyways, use:
git commit --allow-empty
Otherwise, please use 'git reset'
Could not apply 7355eff... "another commit message"
===========================文本错误================================
看起来很混乱,如果有任何提示可以帮助我解决这个问题,将不胜感激。我是一个新手,使用git可能对一些高级用户来说很容易。