Is 'git reset --soft' a no-op command?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 13:56:44

问题


The documentation states that leveraging the --soft option "...Does not touch the index file nor the working tree at all, but requires them to be in a good order. This leaves all your changed files "Changes to be committed", as git status would put it".

It also explains that the target <commit> defaults to HEAD, when not given.

Considering these, does the following command modify anything at all?

$ git reset --soft


回答1:


Considering these, does the following command modify anything at all?

No, it is a no-op.

After thinking about this for a bit: technically it will complain if you are in the middle of a merge with unresolved conflicts however all that this means is that instead of doing nothing, it complains and does nothing.



来源:https://stackoverflow.com/questions/8712555/is-git-reset-soft-a-no-op-command

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