Git stash 技巧

作者: sunnyaxin | 来源:发表于2018-11-06 20:01 被阅读1次

Git stash常用技巧

  1. git stash save
  2. git stash list
  3. git stash apply
  4. git stash pop
  5. git stash show
  6. git stash clear
  7. git stash drop

可配置的stash: git stash save

类似于git stash,但git stash 默认存储到最上面,且没有信息,但这个命令可以配置一些有用的选项,以提高效率:

  1. 带消息存放
git stash save <stash_message>
  1. 存储没有追踪的文件
git stash save -u

或者

git stash save --include-untracked

显示列表: git stash list

查看所有stash信息,按照时间顺序最近的会放在最上面:

git stash list

使用stash且不删除: git stash apply

通过stash id应用某个stash到项目中,且不会被删除:

git stash apply <stash_id>

使用stash且删除: git stash pop

通过stash id应用某个stash到项目中,且会被删除:

git stash pop <stash_id>

显示stash差异: git stash show

通过stash id查看显示差异总结,默认不写id则只和最近的stash比较

git stash show <stash_id>

若想查看具体差异:

git stash show -p

全部删除stash: git stash clear

删除仓库中创建的所有stash

删除某个stash: git stash drop

通过stash id 删除工作栈中最近的stash,默认不写id则只删除最近的stash记录

git stash drop <stash_id>

相关文章

  • Git stash 技巧

    Git stash常用技巧 git stash save git stash list git stash app...

  • stash 操作暂存区

    涉及命令:git stash、stash list、git stash apply、git stash drop ...

  • 【Git】stash

    stash git stash // 加入缓存区git stash save "注释"git stash list...

  • Git Stash

    save stash$ git stash list stash$ git stash list apply st...

  • stash

    git stash ; //暂存 git stash list ;//暂存列表 git stash apply s...

  • 储藏

    查看现有stash : git stash list 移除stash : git...

  • git 缓存的常用方法

    git 缓存的常用方法 git stash2.git stash pop3.git stash list4.git...

  • git手记

    暂存 git stash save {暂存说明}git stash list 查看所有暂存git stash ap...

  • git stash 多单

    git stash 一单 git stash pop 就可以拿出这一单 git stash 多单 git stas...

  • git stash

    git stash 或者git stash save (两种命令相同,save可以添加注释) git stash ...

网友评论

    本文标题:Git stash 技巧

    本文链接:https://www.haomeiwen.com/subject/tshpxqtx.html