在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.

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

我该怎么补救呢?


当前回答

对我来说,一旦我设置了配置,我仍然无法合并。 这是致命的:不可能快进,中止

上述解决方案都不起作用,所以我使用了合并和develop。合并起源/开发

其他回答

Git配置拉。变基假

合并(默认策略)

这意味着您的本地主服务器和远程主服务器已经出现了分歧,这意味着它们都有不能简单地快进的贡献。 为了保持你的本地提交,你可以遵循以下步骤:

1. git switch -C feature_branch (from master, create local branch with your local commits)
2. git switch master
3. git reset --hard origin/master (lose all local changes, and become same as origin/master)
4. git switch feature_branch
5. git merge master (add remote changes to your local)
6. git push
7. Make a pull request for master.

我不知道这是否与您的问题有关,但请注意Git v2.34.0版本有一个问题。git pull命令没有预期的行为。

发布说明中关于Git修复和2021-11-24新版本的消息:

当对方在我们身后的时候,任何策略都应该是“git pull” 成功,因为它是一个没有操作,但没有”。

Git v2.34.1版本说明

我一直在用——ff-only得到错误,所以我只是创建了一个与远程分支同步的新分支:

跳到另一根树枝上:

git checkout -b other-branch

更改它的名称,这样它就不会打扰你:

git branch -m myBranch broken-myBranch

签出你想要同步的远程分支:

git checkout origin/myBranch

为它创建一个本地分支:

git checkout -b myBranch

将远程分支连接到您的:

--set-upstream-to=origin/myBranch myBranch

Git拉源主-rebase

为我工作!