作曲家丢弃变化:[y,n,v,d,s,?]做什么

Mar*_*Fox 111 composer-php

几个月来一直困扰着我的简单问题.

偶尔我会深入到vendor目录来修复bug(特别是我们的内部库).迁移并将修复程序部署到源程序包后,我将composer update company/package在主项目中询问:

Discard changes [y,n,v,d,s,?]
Run Code Online (Sandbox Code Playgroud)

我有一个体面的把握yn,但一直没能找到什么文档v,d,s,?怎么办?我总是打,y但也许我错过了一些有用的东西.


编辑:

  • 添加d选项(oct '17)

Ger*_*osi 171

选择?向您显示详细信息:

y - discard changes and apply the update
n - abort the update and let you manually clean things up
v - view modified files
d - view local modifications (diff)
s - stash changes and try to reapply them after the update
Run Code Online (Sandbox Code Playgroud)

您也可以查看源代码,相关部分在这里.


Rez*_*a S 27

如果你运行--no-interaction,你可以discard-changes: truecomposer.json文件中设置,每次都不会提示您选择此选项.

  • @JakeSylvestre可能晚了一年,但这可能对其他有类似问题的人有用:/sf/answers/1316852001/ (3认同)
  • 无论如何,如果不运行`--no-interaction`就可以启用此选项 (2认同)
  • 有env var来控制丢弃更改`COMPOSER_DISCARD_CHANGES = true composer install --no-interaction` (2认同)