使用git stash

git stash的使用场景是这样的: 当你正在你的分支下进行开发时,这时候你可能需要切换到你的另一个分支去,你可能要pull新的代码下来,但是你又不想添加无用的commit。这个时候你就要用到了git stash, 它的作用是保存当前正在进行的工作,它会将当前工作压入栈中。

基本使用

git stash
// do other things
git pop // or you can do this
git stash save "I just want to save this work and fix my other bug" // list my stash stacks
git stash list // or maybe you will see this
stash@{0}: On master: I want to save my work and fix my bug
stash@{1}: On master: save 1 // 0 is the top of stack // and you will do this to get
git stash apply stash@{1} // or you will do this to get the top of stack
git pop // maybe you need this to clear stack
git stash clear // and last, you maybe need this
git stash --help

最新文章

  1. 分享我们项目中基于EF事务机制的架构
  2. 《深入理解计算机系统V2》学习指导
  3. 【原创】O2O,你真的知道怎么玩吗?
  4. Moon.Orm 5.0(MQL版)分页功能的设计(求指教,邀请您的加入)
  5. Power BI中的QA功能预览
  6. My SQL InnoDB 1217 - Cannot delete or update a parent row:aforeign key constraint fals
  7. 10 个用于收集硬件信息的 Linux 命令
  8. Android企业级程序完全退出的解决方案
  9. centos7 安装kubernetes1.4
  10. Day1 Python 介绍及基础
  11. Celery 源码解析三: Task 对象的实现
  12. android app内部更新适配到8.0
  13. 7.10 break.c 程序
  14. SpringCloud实战9-Stream消息驱动
  15. linux公钥和私钥生成
  16. pkg-config命令的Makefile.am
  17. mybatis学习 十一 缓存
  18. json_encode无返回结果
  19. Linux下使用Nexus搭建Maven私服
  20. POJ3581 后缀数组

热门文章

  1. Akka(39): Http:File streaming-文件交换
  2. Pyhton函数篇(一)之函数中的形参与实参
  3. ES6这些就够了
  4. Android 异步消息处理机制前篇(二):深入理解Message消息池
  5. Solr7.1---数据库导入并建立中文分词器
  6. Linux下实现CAD数据的导出
  7. 递归回溯 UVa140 Bandwidth宽带
  8. day5、文件乱码怎么解决
  9. java poi 导入日期为空
  10. Backtrack无线攻防(很任性的一篇)