对于初学者来说,git中stash和stage两个命令的单词有些相似,有可能会弄混。其实二者是两个完全不同的概念。
1、stash是git中的一个命令。git stash的作用是把工作区(必须是工作区中已经被git追踪到的文件)和索引中的内容暂时存到一个堆上。而且这个堆是和分支不相关的。切换分支后,依然可以看到并使用。
2、stage是git中的一个区域。如下图所示。
可能你也发现了,staging area不就是index么,的确是的。下面是从国外一个网站上找到一段话:
The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit. Its technical name in Git parlance is the “index”, but the phrase “staging area” works just as well.
(from Git - Book)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)