用简单的英语,“git reset”有什么作用?

╄→гoц情女王★ 提交于 2020-08-19 22:28:42

问题:

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