-
save stash
$ git stash
-
list stash
$ git stash list
-
apply stash
#apply the latest stash $ git stash apply #apply older stash $ git stash apply stash@{2}
-
pop stash
#apply the lastest stash and drop it $ git stash pop
-
drop stash
$ git stash drop stash@{0}
-
Creative Stashing
#not stash anything that you've already stages $ git stash --keep-index #also stash any untracked files $ git stash -u #prompt you interactively which of the changes you would like to stash and which you would like to keep in your working directory $ git stash --patch #creates a new branch for you, checks out the commit you were on when you stashed your work, reapplies your work there, and then drops the stash if it applies successfully $ git stash branch testchanges
Git Stash
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 简评:如果你用过一段时间的 Git,你可能会用过 Git stash 命令。它是 Git 最有用的功能之一。以下是...