git stash
来源:互联网 发布:淘宝旗舰店买到假货 编辑:程序博客网 时间:2024/05/17 04:21
当在本地开发一段时间后,突然有了变动,比如想修复一个bug,但是本地新开发的代码不想上传,为了保持线上稳定性。这是,用stash 暂存当前工作,回到git库上最近一次的提交,等完成动作后,再恢复到开发时的状态,继续工作。
首先,添加所有当前以开发的变动:git add .
然后保存改动,并跳到最后一次提交:git stash
则当前状态会最近一次提交,完成工作如修复bug,
用命令:git stash apply
恢复到保存的开发状态,继续工作。
用 git stash pop恢复栈中第一个,也可。
多次stash后,记不清了,可用git stash list 查看所有的保存版本
git stash apply stash@{1}找回栈中第2个,
git stash drop <id>删除一个stash
git stash clear 清空
多次使用’git stash’命令后,git stash list’命令将当前的Git栈信息打印出来,找版本号,例如使用’git stash apply stash@{1}’就可以将stash@{1}恢复
git stash # save uncommitted changes# pull, edit, etc.git stash list # list stashed changes in this gitgit show stash@{0} # see the last stash git stash pop # apply last stash and remove it from the listgit stash --help # for more info
原理性文章:http://www.cppblog.com/deercoder/archive/2011/11/13/160007.html
- git stash
- git stash
- git stash
- git stash
- git stash
- git stash
- Git Stash
- git stash
- git stash
- git stash
- git stash
- git stash
- git-stash
- git stash
- git stash
- git stash
- git stash
- Git - stash
- hdu1963 教你如何从有钱人变更有钱的人
- Android 防止Toast重复弹出相同的信息
- 配置RHEL6使用CentOS的yum源
- ajaxFileUpload插件上传文件
- libev源码分析(一)libev数据结构整理
- git stash
- 亚马逊云计算服务
- JavaScript阻止冒泡事件的事例
- JSONP
- python datetime、time、date
- Jquery Mobile组件的刷新
- 实例解析shell子进程(subshell )
- 【转】android中onMeasure初看,深入理解布局之一!
- 教你如何写好一个网站的标题!