问题:
I have seen interesting posts explaining subtleties about git reset
. 我看到有趣的帖子解释了关于git reset
微妙之处。
Unfortunately, the more I read about it, the more it appears that I don't understand it fully. 不幸的是,我读的越多,我就越不能完全理解它。 I come from a SVN background and Git is a whole new paradigm. 我来自SVN背景,Git是一个全新的范例。 I got mercurial easily, but Git is much more technical. 我很容易变得善变,但Git更具技术性。
I think git reset
is close to hg revert
, but it seems there are differences. 我认为git reset
接近hg revert
,但似乎存在差异。
So what exactly does git reset
do? 那么git reset
究竟做了什么? Please include detailed explanations about: 请包括以下详细说明:
- the options
--hard
,--soft
and--merge
; 选项--hard
, ---soft
和--merge
; - the strange notation you use with
HEAD
such asHEAD^
andHEAD~1
; 与HEAD
使用的奇怪符号,如HEAD^
和HEAD~1
; - concrete use cases and work flows; 具体用例和工作流程;
- consequences on the working copy, the
HEAD
and your global stress level. 对工作副本,HEAD
和您的全球压力水平的影响。
解决方案:
参考一: https://stackoom.com/question/AcBQ/用简单的英语-git-reset-有什么作用参考二: https://oldbug.net/q/AcBQ/In-plain-English-what-does-git-reset-do
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4355916