git stash 的进阶用法
很多人(包括以前的我)只用 git stash 和 git stash pop。其实它能做的多得多。
常用但容易被忽略的
git stash push -m "wip: 重构登录页" # 带备注,方便以后认
git stash list # 看都有哪些
git stash show -p stash@{1} # 看具体内容
git stash apply stash@{2} # 应用但不删除
git stash drop stash@{0} # 单独删一个
git stash branch fix/login stash@{1} # 直接从某个 stash 开分支
最后一个特别有用:stash 完改了别的,再回来时直接开分支,避免冲突。