要更改记录堆栈的保存,请执行以下操作:
git stash push -u -m 'msg' //-u ~ --意思是包含未跟踪的文件
git stash push -m 'msg '
git stash //将当前更改保存到stash@{0},stash缓存工作站的顶部
git stash save -u 'msg '
git stash save -a 'msg' //包含所有文件,如. gitignore .
推送和保存的区别:
save [-p|--patch ] [-k|--[ no-] keep-index ] [-u|--include-un tracked ] [-a|--all ] [-q|- QQ
thisoptionisdeprecatedinfavourofgitstashpush.itdiffersfrom ' stash push ' inthatitcannotakepathspecs,andanynon-option argtion
push [-p|--patch ] [-k|--[ no-] keep-index ] [-u|--include-un tracked ] [-a|--all ] [-q|- QQ
saveyourlocalmodificationstoanewstashentryandrollthembacktohead (intheworkingtreeeandintheindex ).thepartisoptionalanandgivestivestion
For quickly making a snapshot,you can omit 'push'. In this mode, 非onon-optionargumentsarenotallowedtopreventamisspelledsubcommandfrommakinganunwantedstashentry.thetwoexceptionstothiothisaresaresthiothiothiothisaredestoresarestorestoresthed ush-pandpathspecs,whichareallowedafteradoublehyphen-- fordisambiguation。
https://git-SCM.com/docs/git-stash
浏览gitstashlist//stash列表
1、对stash进行更改
git stash save'messeag '
git stash save -m'messeag '
git stash save -u'messeag '
git stash save -a 'messeag '
-a表示全部。 不仅要将新添加的代码文件放入临时区域,还要将. gitignore忽略的文件放入临时区域。 如果不希望影响被忽略的文件,请使用-u表示untracked files。
2、撤消变更
git stash list查看stash列表,从中选择要pop的stash,然后运行命令
git stash pop stash@{id}
或者
git stash apply stash@{id}即可
3、删除stash
如果git stash drop不添加stash编号,则缺省情况下会删除最新的,即编号为0的,而进行编号则会删除指定编号的stash。
git stash clear是清除所有的stash
4、git stash pop与git stash apply的区别。
执行git stash pop stash@{id}命令后,从stash list中删除相应的stash id,git stash apply stash@{id}命令继续保存stash id
5 .查看指定stash的diff
git stash show
git stash show stash@{id}
补充:
注意: []方括号中的内容是可选的。 []中的stash是表示进度的编号。 例如,stash@{0},尖括号内的必填项
git stash保存当前临时区域和工作区的状态。
git stash list显示所有已保存进度的列表。
git stash pop [--index] []恢复工作进度
git stash apply [--index] []不删除恢复的进度,其他与git stash pop相同
git stash drop []删除进度,默认情况下删除最新进度
git stash clear将删除所有进度
git stash branch将根据进度创建分支
refs:
https://git-SCM.com/docs/git-stash
git stash命令总结
3359 blog.csdn.net/c _ z _ w/article/details/52862129
progit
https://git-scm.com/book/zh/v2
同步
git stash list []
git stash show []
git stash drop [-q|--quiet] []
gitstash(pop|apply ) [--index] [-q|--quiet] []
git stash branch []
git stash [-p|--patch ] [-k|--[ no-] keep-index ] [-q|--quiet ]
[-u|- include-un tracked ] [-a|--all ] [-m|--message ]
[--] [… ]]
千兆位状态清除程序
git stash create []
gitstashstore [-m|--message ] [-q|- quiet ]