如何编辑和推送初始(根)提交中的更改?

问题描述 投票:-1回答:1

所以,仅说明我的当前情况:

  • 我一直将更改推送到原始主机(尚未建立分支)
  • 我决定更改Github存储库的首次提交的提交消息
  • 我做了$ 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 '[email protected]: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.

我在做什么错?

git github rebase
1个回答
0
投票

如果仅是尝试修改最后的提交-使用ammend

© www.soinside.com 2019 - 2024. All rights reserved.