为什么Git不允许我快进合并了?如果我试图使用——ff-only强制它,我会得到消息“致命:不可能快进,终止。”我意识到合并-no-ff有巨大的优势,但我只是不明白为什么我现在不能-ff-only ?
当前回答
免责声明:这些命令将从远程分支到您的分支中带来更改。
快拉,变基。与其他解决方案不同,您不需要知道目标分支的名称。
如果你的上游分支没有设置,尝试git拉origin <branch>—rebase(在评论中归功于@Rick)
要全局设置这个选项,使用git config——global pull。rebase true(归功于@Artur Mustafin)
其他回答
如果你有一个提交,尝试撤销它,再拉一次!
如果在未来得到这个git错误,这个解决方案将帮助你
从(development/master/main)导入到本地分支时出现错误: 错误信息:
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.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 --re base, --no-re base, 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配置文件并添加这一行 1)(拉) Ff = no 如果第一步对你不起作用,那么就应用第二步
2)git pull -ff-only或git config -global pull。ff只
如果您在本地分支上执行git pull origin master时遇到此情况,请在记事本中打开.gitconfig(通常隐藏在C:\Users\Myname中)并添加这两行
[pull]
ff = no
保存配置并再次尝试git pull origin master
尝试一下,会工作得很好----
Git拉原点-rebase
这是我的工作,你可以用它git pull -no- off
推荐文章
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- git pull -rebase和git pull -ff-only之间的区别