今天我发现了--no-edit
的--amend
。但是,它引出了以下问题。这里的步骤:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/myRepo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
为什么?
注意:我是唯一一个处理该回购的人。
修改上次提交会重写历史记录。如果你想做什么,你可以用git push --force
做到这一点。
它告诉你落后的原因是因为本地和远程存在的最后一次提交(又名“合并基础”)是提示的父级。在这方面,你是远程的一个提交,它已经在上述合并基础之上提交了一个提交。