赞
踩
报错
hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. fatal: Need to specify how to reconcile divergent branches.
这个提示是Git给出的,旨在帮助你决定如何处理分叉的分支,在你下一次执行git pull
操作时如何合并这些更改。当本地分支和远程分支有不同的提交历史时,就会出现分叉,这通常发生在别人已经推送了一些提交到远程仓库,而你的本地仓库还没有这些更新。
Git提供了三种策略来解决这个问题:
git config pull.rebase false
git pull
时合并远程分支的更改。如果有冲突,需要手动解决。这是默认策略。git config pull.rebase true
git config pull.ff only
git pull
操作不能通过快进完成(即需要合并或变基来解决分叉),这个命令会导致失败。为了设置所有仓库的默认拉取策略,你可以使用--global
标志
git config --global pull.rebase false
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。