【发布时间】:2020-01-04 14:05:35
【问题描述】:
所以,简单解释一下我现在的情况:
- 我不断将更改推送到 origin master(尚未创建分支)
- 我决定更改 Github Repository 初始提交的提交消息
- 我做了
$ git rebase -i --root并成功更改了提交消息 -
我尝试通过
$ git push --force强制推送,但得到以下错误:fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master. 我尝试按照说明进行操作,但得到:
! [rejected] master -> master (non-fast-forward) error: failed
to push some refs to 'git@github.com:BLAHBLAH.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.
我做错了什么?
【问题讨论】: