git - 自动 merge package-lock.json

标签 git github gitlab

git merge --no-ff account-creation

自动 merge package-lock.json 冲突(内容):package-lock.json 中的 merge 冲突 自动 merge 失败;修复冲突,然后提交结果。

关于这个问题有什么想法吗?

最佳答案

根据 docs :

Resolving lockfile conflicts

Occasionally, two separate npm install will create package locks that cause merge conflicts in source control systems. As of npm@5.7.0, these conflicts can be resolved by manually fixing any package.json conflicts, and then running npm install [--package-lock-only] again. npm will automatically resolve any conflicts for you and write a merged package lock that includes all the dependencies from both branches in a reasonable tree. If --package-lock-only is provided, it will do this without also modifying your local node_modules/.

To make this process seamless on git, consider installing npm-merge-driver, which will teach git how to do this itself without any user interaction. In short: $ npx npm-merge-driver install -g will let you do this, and even works with pre-npm@5.7.0 versions of npm 5, albeit a bit more noisily. Note that if package.json itself conflicts, you will have to resolve that by hand and run npm install manually, even with the merge driver.

关于git - 自动 merge package-lock.json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50160311/

相关文章:

git - 是否有包含 merge (仅)和非 merge 提交的 `git log` 摘要?

git - 如何跨 git 存储库共享文件?

java - JGit 仅遍历本地和远程分支并读取文件

git:忽略源中的文件

gitlab - .gitlab-ci.yml 中的 `cache:key` 有什么意义?

GIT 迁移后的 repo 比原来的要小得多

docker - 无人机 CI 在克隆步骤上失败

git - 拆分现有存储库并将最新提交应用到另一个存储库

javascript - 如何使用 GitHub API 使用已登录用户在 GitHub 上发布问题 stub ,无需身份验证 key ?

tomcat - 我的任务是在本地 tomcat 服务器上运行 Jenkins 源代码