merging package.json in git (solving version conflict)

家住魔仙堡 提交于 2020-02-01 07:45:56

问题


We keep getting a conflict for the version field in the package.json. For instance:

"version": "1.1.144"

and:

"version": "1.1.145"

Is there a way to auto-resolve it with the highest version number?


回答1:


Ended up writing an npm package that checks for the version in the remote and sets the local version to match.

npm install -g node-version-match

and from a project's directory:

level

This will sets the local package.json version to match the remote package.json version:

{
  "name": "package",
  "version": "0.0.152", // <=== sets this to equal the version in remote
 ...

This prevents conflicts before pulling, afterwards we change the version number, commit & push.



来源:https://stackoverflow.com/questions/49382839/merging-package-json-in-git-solving-version-conflict

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!