今天我发现了使用
--amend
命令时可以结合使用--no-edit
参数,但这给我带来了一个问题。以下是具体步骤:
- git clone
- did some changes to the code
- git add .
- git commit --amend --no-edit
git push origin master
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://me@bitbucket.org/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 fetch origin
命令时,origin/master
跟踪分支是否会有任何更新? - Tim Biegeleisen