javascript - NodeGit - 解决有利于 "theirs"的 merge 冲突

标签 javascript node.js git nodegit

在git中我们可以使用如下命令来实现:

git merge branch_name --strategy-option theirs

但我无法在 nodegit 中找到方法:http://www.nodegit.org/api/repository/#mergeBranches

 repo.mergeBranches("master.min", "master", null, merge.PREFERENCE.FASTFORWARD_ONLY);

存在一个文件偏好枚举

http://www.nodegit.org/api/merge/#FILE_FAVOR

但是 repo.mergeBranches() 需要 PREFERENCE 枚举。如何为 merge 传递 FILE_FAVOR 枚举。

编辑:添加跟踪问题:

https://github.com/nodegit/nodegit/issues/858

最佳答案

目前(2015 年 1 月),您不需要。

方式Repository.prototype.mergeBranches (lib/repository.js#L730-L745)已实现,它不考虑任何 FILE_FAVOR 选项(由 their vendored libgit2 使用)。

这可能是类似于 PR 633 的 PR( pull 请求)的主题(其中引入了选项 --no-ff--ff-only)

关于javascript - NodeGit - 解决有利于 "theirs"的 merge 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34671270/

相关文章:

javascript - RegEx-如何解析 html 页面的模式(在 JavaScript 中)

javascript - 如何对调用另一个返回 promise 的函数进行单元测试?

node.js - Node Js中如何选择首先调用哪个函数

javascript - 无法将数据插入组合数据数组

git - 在等待 pull 请求时继续处理本地 git 存储库的明智方法

objective-c - 从现有项目托管的 Github(和本地)创建 cocoapod

javascript - 由于 cookie 或其他原因,Chrome 不更新脚本和 rss?

Javascript promise 停留在挂起状态

javascript - 如何在使用 node.js 时从 URL 中获取 Id

git - 当我在 Android Studio 4.1 中使用 Git 时,如何显示所选文件的所有分支中的所有历史文件