'git reset --soft'是一个无操作命令吗? [英] Is 'git reset --soft' a no-op command?
问题描述
文档指出,利用 - 软
选项...根本不触摸索引文件或工作树,但要求它们的顺序很好,这会使所有更改的文件更改被提交,因为git状态会把它放在。
它也解释了目标< commit> $ c $如果没有给出,默认情况下为HEAD。
考虑到这些,下面的命令是否修改了所有内容?
$ git reset --soft
考虑到这些,以下命令是否修改了所有内容?
不,它是一个没有操作。
在考虑了这一点之后:从技术上讲,如果你处于未解决冲突的合并中,就会抱怨,但是这意味着而不是d什么也没有,它抱怨,什么都不做。
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
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.
这篇关于'git reset --soft'是一个无操作命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!