git stash 当本地代码不想提交覆盖,又忙于其他分支,可以先储存起来。
git stash
存储当前工作目录
$ git stash Saved working directory and index state WIP on Practice: 2f70846 Complete practice view and network
git stash list
查看之前存储的所有版本列表
$ git stash list stash@{0}: WIP on Practice: 2f70846 Complete practice view and network stash@{1}: WIP on Practice: 2f70846 Complete practice view and network stash@{2}: WIP on Practice: 2f70846 Complete practice view and network stash@{3}: WIP on Practice: 2f70846 Complete practice view and network stash@{4}: WIP on Practice: 812e77b Add collectionView and AnswerView stash@{5}: WIP on Practice: 53bb0c1 add tableView of questions and refactor the code of scrollView
git stash pop [stash_id]
恢复具体某一次的版本,如果不指定stash_id,则默认h恢复最新的存储进度
$ git stash pop stash@{0} Auto-merging WePeiYang/Shared/Network/SolaSessionManager.swift CONFLICT (content): Merge conflict in WePeiYang/Shared/Network/SolaSessionManager.swift Auto-merging WePeiYang/Practice/Practice/QuestionTableView/OptionsCell.swift CONFLICT (content): Merge conflict in WePeiYang/Practice/Practice/QuestionTableView/OptionsCell.swift Auto-merging WePeiYang/Practice/Practice/Exercise/Model/ExerciseNetwork.swift Auto-merging WePeiYang.xcodeproj/project.pbxproj CONFLICT (content): Merge conflict in WePeiYang.xcodeproj/project.pbxproj
git stash clear
原文链接:https://www.jianshu.com/p/a634af0eb343?from=singlemessage
原文:https://www.cnblogs.com/panax/p/11912965.html