composer discard changes: what do the [y,n,v,d,s,?] do

匿名 (未验证) 提交于 2019-12-03 02:45:02

问题:

Simple question that's been bugging me for months.

Occasionally I'll dive into the vendors directory to fix a bug (especially for our internal libs). After migrating and deploying the fix back to the source package, I'll composer update company/package in the main project and am asked:

Discard changes [y,n,v,d,s,?] 

I have a decent grasp on y and n but haven't been able to find documentation about what v, d, s, ? do? I always hit y but maybe I'm missing out on something useful.


Edits:

  • added d option (oct '17)

回答1:

Choosing ? shows you the details:

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 

You can also check the source code, the relevant part is here.



回答2:

If you run with the --no-interaction, you can set discard-changes: true in composer.json file and you wont get prompted for this option every time.



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