问题:
On branch master
Your branch and 'origin/master' have diverged,
and have 4 and 10 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean
如果不需要保留本地的修改,执行下面两步:
git fetch origin
git reset --hard origin/master
当我们在本地提交到远程仓库的时候,如果遇到上述问题,我们可以首先使用如下命令:
git rebase origin/master
git pull --rebase
git push origin master
把内容提交到远程仓库上。