stash
git stash // 加入缓存区
git stash save "注释"
git stash list // 查看缓存区
git stash pop // 从缓存区恢复
git stash pop stash@{0} // 恢复第0个
git stash drop stash@{0} // 删除第0个
git stash clear // 清空
场景:
正在分支1开发,
需要切换到分支2修改bug,
又不想把分支1commit,
这时:
1. 先在分支1:git status
2. git checkout 分支2
3. 分支2修改,并push
4. git checkout 分支1
5. git stash pop;// 取出缓存区内容
网友评论