- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经阅读了很多关于主题错误消息(“不可能快进”)的其他问题,但似乎没有一个适用于我的情况。我创建一个分支 (git checkout -b issue-215
),进行更改,然后在本地提交。我推送更改,然后进行新的更改和另一个本地提交:
* 4b797d2a - (HEAD -> issue-215)
* 180a7ab5 - (origin/issue-215)
* 863ef01a - (origin/master, origin/HEAD, master)
预计到达时间:根据评论中的要求,git branch --all -v
的输出:
* issue-215 4b797d2a [ahead 1]
... other branches ...
master 863ef01a
remotes/origin/issue-215 180a7ab5
...other remotes....
remotes/origin/HEAD -> origin/master
remotes/origin/master 863ef01a
没有新的远程更改,但 VSCode 希望在推送之前先 pull 。那就是我收到此错误的地方。因此,为了排除故障,我手动运行 git pull origin issue-215
,并获得以下输出:
$ git pull origin issue-215
From ssh://my.repo/project
* branch issue-215 -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
请记住,服务器上没有新的更改,并且从我当前本地提交的历史记录返回到远程分支,返回到 master
和 origin/master
,是一条直线。我不是要 merge 或 rebase ,我的本地代码已经是我应该 pull 的分支的直接子代码。
这大约在一个月前才开始发生。以前,单击 VSCode 中的“同步”按钮会起作用,但从那时起它总是失败并显示此错误消息。我是否可以进行某种导致此行为的 gitconfig 更改?我的全局 gitconfig 文件中没有太多内容,而且至少有 2 个项目会发生这种情况,所以我认为这不是我对存储库所做的事情。
最佳答案
这是 Git 版本 2.33.1 的一个已知问题。它应该在 2.33.2 中修复。 其他通常有用的建议如下:
“无法快进”消息意味着您将 git pull
配置为使用 git merge --ff-only
,可能使用 git仅配置 pull.ff
。所以 git pull
尽职尽责地运行:
git fetch origin issue-215
git merge --ff-only FETCH_HEAD
第二个命令给出错误并停止。 (编辑:如果您自己手动执行此操作并且它有效,则您遇到了脚注 1 中的错误。)
Keep in mind, there are no new changes on the server, and the history from my current local commit back to the branch on the remote, back to master and origin/master, is a straight line.
很明显(根据错误),它不是。1 获取后,运行:
git log --all --graph --decorate --oneline FETCH_HEAD
看看哪里它不是; 为什么它不是另一个问题。我怀疑答案是这样的:
来源
是GitHub;fetch
获得的提交在逻辑上等同于您之前推送的提交,但具有不同的哈希 ID.常规 merge 或 rebase 会起作用,但 ff-only
不会。 (这不是唯一可能的解释:例如,其他托管站点具有相同的效果,但有时按钮标签不同。)
This only started happening about a month ago. Previously, clicking the "sync" button in VSCode would work, but since then it always fails with this error message. Could I have made some kind of gitconfig change that causes this behavior?
它可能是您更改的内容,例如将 pull.ff
设置为 only
。它可能是其他人更改的,例如从 GitHub 上的 MERGE 切换到 REBASE AND MERGE。
1Git 2.33.1 中有一个错误,其中 pull.ff only
拒绝了它不应该有的空操作情况。如果你有 Git 2.33.1,要么升级它,要么使用 git fetch
,然后在这种情况下使用 git merge --ff-only
。
关于git - `git pull` 失败,现有历史记录为 "Not possible to fast-forward",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69828306/
背景 之前陆续写过一些和 OpenTelemetry 相关的文章: 实战:如何优雅的从 Skywalking 切换到 OpenTelemetry 实战:如何编写一个 OpenTeleme
我很困惑PSReadLine历史在 Powershell 中跨 session 工作。我可以在 PS 版本 5.1 中看到我以前的命令历史记录自动存储在 %userprofile%\AppData\R
我有一个实体,我正在从面板中保存我们的数据库,您可以在其中执行常规操作(编辑、添加等)。不是很大,大多数时候大约有 1k 行,而且这个数字可能总是在这个左右。该实体有一些与其他实体相关的字段(例如:位
有时有人想直接在环境中更改 crx 中的内容。 这通常是环境不工作状态的原因。而且往往很难找到问题的原因。而且我认为如果 cq5 crx 有审计日志会很有帮助。像这样。 12.12.12 21:03
这个问题与可以在其他问题之一中找到的模式有关here.基本上在数据库中,我存储用户,位置,传感器等。所有这些内容都可以由用户在系统中编辑,并且可以删除。 但是-在编辑或删除项目时,我需要存储旧数据;我
我需要随时跟踪许多项目及其状态。 例子 ItemId Location DateTime State 1 Mall A 2010-02-03 07:00 on
我有这个方法来添加 fragment : public void addFragmentOnTop(Fragment fragment) { getSupportFragmentManager()
我想了解 HTML5 历史对象。这是我开始的一个简单示例。 function addDialog(){ document.getElementById('d').style.
我如何使用 HTML5 history api。我确实通过了https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
我正在尝试找出在关系数据库中保存表的历史记录/修订的最佳方法。 我进行了一些研究和阅读,但不确定跟踪更改的最佳方式是什么。对于我的主表,我很确定我已经确定了一个修订表,以保持跟踪(见图),但我不确定是
这个问题在这里已经有了答案: Git: discover which commits ever touched a range of lines (6 个答案) 关闭 9 年前。 我一直在研究 gi
我有一个相当复杂的程序(带有 SWIG'ed C++ 代码的 Python,长期运行的服务器),它显示了不断增长的常驻内存使用量。我一直在使用常用的泄漏工具(valgrind、Pythons gc 模
我的 Git 存储库中有一行包含单词“Foo”的数百次提交。 是否有任何方法可以在上次的位置找到它的修订号? 最佳答案 这可以通过 -S 的镐 ( gitlog ) 选项来解决。 git log -
我不小心删除了一个文件(我不是他的创建者)并提交并将其推送到远程。现在我想让 git 取消删除此更改,但是当我使用 git revert #mistaken commit 时,它可以工作,但指责信息指
我使用 spyder 历史 Pane 查看我过去尝试过的命令,但最近我注意到它不会在我键入命令时更新。屏幕截图 1 显示了控制台和历史记录 Pane ,因为您可以看到历史记录中没有显示任何控制台条目。
我的应用程序使用 Camunda 7.7 运行。到目前为止,所有数据都保存在 Camunda 表 (ACT_XXX) 中——它们变得很大。所以现在我想清理表格并配置 Camunda,以便在 14 天后
我在 SVN 上有一个这样组织的旧项目: /一些/子目录/a/trunk/foo /一些/子目录/b/trunk/foo /一些/子目录/c/trunk/foo 我使用GitHub工具git-impo
我有一个通用的工作功能,为此我将使用 GNU Radio 的历史记录功能。在 block 的构造函数中,我调用了 set_history( m )。我以标准方式转换输入缓冲区: const flo
当我加载 php 页面时,我会附加一些数据。例如 MyPage.php?value=something。正如预期的那样,当我使用后退按钮来回移动时,它总是会加载附加的相同数据。我不想那样。我希望在页面
我们有一个相当大的库,我们需要定期将其导入(然后修补)到我们的代码库中。 SVN Book 似乎推荐了一个“vendor branch”方案,我们保留了“vendor drops”的补丁版本。这会起作
我是一名优秀的程序员,十分优秀!