- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
经过 git pull 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.
那么pull就成功了。但是,我仍然对这条消息表示怀疑。
最佳答案
In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD.
git pull origin master
,
git pull
执行 merge ,这通常会创建 merge 提交。因此,默认情况下,从远程 pull 并不是一个无害的操作:它可以创建一个以前不存在的新提交 sha。这种行为会使用户感到困惑,因为感觉应该是无害的下载操作实际上以不可预测的方式改变了提交历史。
git pull --ff-only
(或不?继续阅读,看看哪一个符合您的要求)
git pull --ff-only
, Git 只会更新你的分支,如果它可以“快进”而不创建新的提交。如果做不到,
git pull --ff-only
只是中止并显示错误消息。
--ff-only
默认情况下,即使您忘记了命令行标志,您也会得到这种行为:
git config --global pull.ff only
注意:
--global
标志将更改应用于您机器上的所有存储库。如果您只希望对您所在的存储库进行此行为,请省略该标志。
Pulling without specifying how to reconcile divergent branches isdiscouraged. You can squelch this message by running one of the followingcommands 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 defaultpreference for all repositories. You can also pass --rebase, --no-rebase,or --ff-only on the command line to override the configured default perinvocation.
git config pull.rebase false # merge (the default strategy)
这将保留默认行为并抑制警告。
git config pull.rebase true # rebase
这实际上是在远程分支之上提交,在本地和远程维护一个分支(与涉及两个不同分支的默认行为不同 - 一个在本地,另一个在远程 - 并且,将两者结合起来,执行 merge )。
git config pull.ff only # fast-forward only
如果本地分支可以快进,这只会执行 pull 。如果没有,它会简单地中止并显示错误消息(并且不会创建任何提交)。
Git 2.29
或以上,您现在可以设置
pull.ff
至
false
,
true
或
only
摆脱警告。
git config pull.ff true
true
- 这是默认行为。如果可能, pull 是快进的,否则它被 merge 。
git config pull.ff false
false
- pull 永远不会快进,并且总是会创建 merge 。
git config pull.ff only
only
- 如果可能, pull 快进,否则操作将中止并显示错误消息。
关于git - 如何处理这个 git 警告? "Pulling without specifying how to reconcile divergent branches is discouraged",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62653114/
有没有办法 git pull 直到有东西可以 pull 。 假设我正在等待一位同事推送他的最新更改,因为我不耐烦并且没有看他的屏幕,我只是运行 watch git pull 直到我看到有东西被 pul
这个问题在这里已经有了答案: What is the difference between 'git pull' and 'git fetch'? (37 个答案) 关闭 6 年前。 这个问题我一直
我有一个分支,想使用 $ git pull origin master 将 master 中的更改 git在我这样做之后, pull 确实没有显示任何 merge 的 PR 被 pull 并且说它已经
在各个地方,寻找有关如何从 GitHub merge 请求创建本地分支的说明,我看到了两个版本: git fetch upstream refs/pull/PR_ID/head:NEW_LOCAL_B
我已经在github上创建了一个仓库。 Upstream中有一些新的 pull 请求。我想从本地上游 pull 请求。 我怎样才能做到这一点?我不知道,没有发现任何与此相关的信息。 最佳答案 通过首先
假设我 fork 一个 GitHub 项目并进行一些更改,然后为要 merge 到的更改创建 pull 请求我从中 fork 的原始项目。 一旦我这样做了,如果我返回到我的 fork 项目并提交更多文
我在 BitBucket 上有一个 Git 存储库。我有两个分支 master 和 db。在我的笔记本电脑上,我对 db 进行了更改,提交了更改并推送到 BitBucket。我可以在该分支中看到提交。
我在分支 tm-skeleton并执行 git pull 做某事(从技术上讲,它要求输入密码,然后我在那里点击了 ),但我怎么知道它从哪里 pull ?通常,[branch "tm-skeleton"
我们在组织中使用 Github 进行源代码控制。多个开发人员不断地将他们的更改 merge 到远程源存储库。就我而言,我在两周前克隆了存储库,之后进行了多次 merge 。现在我正在尝试获取代码的最新
在 merge pull 请求之前,我想在本地快速 pull 请求并运行测试并测试一些内容。我还不想点击 gihub merge pull 请求。 我认为滑轮会有所帮助 http://ejohn.or
我有一个服务器,其中有一些我不知道我在哪里的配置我只是 git pull 并获取 github 存储库中的内容,然后重新启动它以进行部署。 问题是,有一个不是我最新的提交,它实际上不在我的服务器上。这
我是 Git 的新手,所以如果这是微不足道的,我深表歉意。我有一个使用 Github 和 EGit 设置的私有(private)存储库. 要更新并 merge 我的本地存储库分支与远程版本(本质上是g
pull 请求的发起者可能 give the maintainer the ability to edit the pull request . 对于任何给定的 pull 请求,我们如何判断该能力是否
我 fork 了一个GitHub存储库,并在 fork 上进行了一些更改,然后提交了一个 pull 请求,但是原始GitHub存储库的所有者要求对它们进行 pull 请求中的一些更改。我以为在fork
如何使用 Git GUI 工具进行拉取?似乎任何地方都没有 pull 命令。 是否有使用 Git GUI 的等效菜单选项? 任何帮助将不胜感激。 最佳答案 嗯,我发现这个有用的论坛帖子: https:
我制作了一个程序来从我的 github 上托管的公共(public)存储库中提取数据。克隆一个项目工作得很好(无论如何我都是这样做的),但我一直在努力让它工作以提取所有内容,一旦你删除一个文件,它不再
哪个比另一个更可取,为什么?如果我在提交之前 pull ,其他开发人员所做的更改是否与我当前正在处理的内容 merge ?如果是这样,那意味着这个更可取? 最佳答案 最好先提交。 pull 而不提交可
我对使用 git 在团队中工作还很陌生。 我从“origin/master”开始。 首先我创建了一个新分支feature/26062018-offline-seite_ef。 我添加了提交。 我检查了
这个问题在这里已经有了答案: Retrieve specific commit from a remote Git repository (11 个答案) 关闭 9 年前。 我在本地创建一个空的新存
我开始在 Github 上使用新的 pull 请求草案功能,但我想知道在我不小心发出 pull 请求的情况下是否可以将合法的 pull 请求转换回 pull 请求草案。 最佳答案 如前所述on Twi
我是一名优秀的程序员,十分优秀!