git stash

博客来源:http://blog.csdn.net/dawn_moon/article/details/6977388

git stash 的几种使用方法 :

1 git stash
2 git stash list
3 git stash clear
4 git stash apply
View Code

 

git stash 将当前所有修改项(未提交的)暂存,压栈。此时代码回到你上一次的提交,用git status可查看状态。

git stash list将列出所有暂存项。

git stash clear 清除所有暂存项。

git stash apply 将暂存的修改重新应用,使用git status可以看到以前暂存的修改又回来了

这几个命令常用来干几件事情。当修改项还不确定要提交,又要将代码更新或则回去改bug,此时可以用git stash将修改项暂存,然后想干嘛干嘛,干完之后git stash apply,以前的修改项又回来了,可以继续完成修改。

posted @ 2014-11-11 10:25  wmx3ng  阅读(317)  评论(0编辑  收藏  举报