git暂存操作,git stash暂存操作

管理员

git暂存

#查看当前状态
git status 

如果有修改,添加修改文件

git add .
#暂存操作
git stash save '暂存标识名字'

查看暂存记录

git stash list

     index        分支          暂存标识名字   
stash@{0}: WIP on dev: 885d8d80 测试暂存
stash@{1}: WIP on test: c39acb0d 测试暂存1
stash@{2}: WIP on sf: 72a17e11 测试暂存2

恢复暂存的工作
pop命令恢复,恢复后,暂存区域会删除当前的记录
#恢复指定的暂存工作, 暂存记录保存在list内,需要通过list索引index取出恢复

git stash pop stash@{index} #git stash pop stash@{2}

apply命令恢复,恢复后,暂存区域会保留当前的记录
#恢复指定的暂存工作, 暂存记录保存在list内,需要通过list索引index取出恢复

git stash apply stash@{index} #git apply pop stash@{3}

删除暂存

#删除某个暂存, 暂存记录保存在list内,需要通过list索引index取出恢复
git stash drop stash@{index}
#删除全部暂存
git stash clear

[原文链接]https://blog.csdn.net/kuangdacaikuang/article/details/82804051

0人点赞
Git
管理员

全部评论 0