在git拉origin master之后,我得到了以下消息:

warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 51.49 KiB | 850.00 KiB/s, done.

拉动似乎成功了,但我不确定。

我该怎么补救呢?


当前回答

在我的例子中,当我只想获得我想要的分支的最新更新时,我正在从一个不同的分支进行拉取。我把树枝换回去,它就恢复正常了。

其他回答

让我们举个例子,你从开发分支创建了一个分支A,在从开发分支拉到分支A的过程中,出现了这个发散的问题。你不能把更新代码从开发到你的A分支。因此,请按照以下步骤解决此问题

Git签出开发分支(这将切换到开发分支) Git拉(它将拉所有的更改来开发) git checkout A-feature-branch(这将切换到你的feature branch) Git合并开发分支(它将合并所有更改到您的功能分支)

现在,您已经将代码从develop更新到本地分支。 享受你的编码:)

Git配置拉。变基假

合并(默认策略)

这对我很有用

git config --global pull.ff true

如果你从一个分叉回购,像我一样:P,试试这个

git push -f origin <branch_name>

这个被推了。如果有任何冲突,您可以从git中处理

在我的例子中,当我只想获得我想要的分支的最新更新时,我正在从一个不同的分支进行拉取。我把树枝换回去,它就恢复正常了。