Ami*_*ole 9 git git-amend merge-conflict-resolution
这是发生的事情:
git commit --amend并保留与HEAD相同的提交消息git push现在我明白了
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commit each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)
我想明白:
Von*_*onC 10
您更改了现有的推送提交,创建了自己的版本(因为其内容已更改)
--x---Y (master: that is the X amended)
\
--X (origin/master)
Run Code Online (Sandbox Code Playgroud)
这就是为什么你在master和origin/master之间有1个和1个不同的提交
我该怎么做才能防止这种情况发生?
不要"修改"现有的推送提交(只有本地尚未推送的提交)
git修改后如何调和master和local?
只需在原点/主控上重新设置,然后按下
git rebase origin/master
--x--X---Y' (master)
|
(origin/master)
git push
--x--X---Y' (master, origin/master)
Run Code Online (Sandbox Code Playgroud)