还在学习GIT。尝试将我的本地存储库与在“中央存储库”样式远程存储库上完成的提交同步。第一步是获取来源:
git fetch origin
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 1 (delta 0)
Unpacking objects: 100% (1/1), done.
From ssh://github.com/XXXXXX/ZZZZZZZZ
bc2afff..3b3c8ee master -> origin/master
然后检查状态和分支。
git status
# On branch master
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
#
nothing to commit (working directory clean)
git br
* master
然后尝试--ff-only。
git merge --ff-only origin master
fatal: Not possible to fast-forward, aborting.
好的,所以做一个非 ff 合并:
git merge origin master
Fast-forwarding to: origin
Already up-to-date with master
Merge made by the 'octopus' strategy.
检查提交:
git show 4cbd3
...snip...
Merge branch 'master', remote-tracking branch 'origin'
似乎完成了非 ff 合并。合并“Fast-fowarding to: origin”的输出令人困惑——它想告诉我什么?我错过了什么?谢谢!