git stash 后"本地代码不见了"
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@{}
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
莫慌,莫慌
这是因为出现合并冲突的问题而导致工程文件打不开。
这时候右击工程文件,单击“显示包内容”,打开“project.pbxproj”文件,然后command + f 搜索 “stashed”。把冲突部分删掉就可以重新打开啦
git stash drop [stash_id]
删除一个存储的进度。如果不指定stash_id,则默认删除最新的存储进度。
git stash clear清除所有的存储进度
原文链接:https://www.jianshu.com/p/a634af0eb343?from=singlemessage
git stash 后"本地代码不见了"的更多相关文章
- Git 分支管理-git stash 和git stash pop
https://blog.csdn.net/u010697394/article/details/56484492 合并分支,冲突是难免的,在实际协作开发中我们遇到的情况错综复杂,今天就讲两个比较重要 ...
- Git Stash方法
命令:git stash1.使用git stash 保存当前的工作现场, 那么就可以切换到其他分支进行工作,或者在当前分支上完成其他紧急的工作,比如修订一个bug测试提交. 2.如果一个使用了一个gi ...
- Lunix git stash clear 或者 git stash drop后恢复的方法
首先输入 git fsck --lost-found 会看到 一条一条的记录 这里的"dangling commit ..."你可以理解为记录的是你stash的id(经测试,该id ...
- git stash简介
原文:http://gitbook.liuhui998.com/4_5.html 一.基本操作 当你正在做一项复杂的工作时, 发现了一个和当前工作不相关但是又很讨厌的bug. 你这时想先修复bug再做 ...
- 第23月第24天 git命令 .git-credentials git rm --cached git stash clear
在git push的时候,有时候我们会想办法撤销git commit的内容 1.找到之前提交的git commit的id git log 找到想要撤销的id 2.git reset –hard id ...
- git学习(六):git stash
对于更改操作的处理 使用git status命令可以看到当前工作区的状态: git status // 查看工作区的状态 // 对于已经git add工作区中文件 git reset HEAD < ...
- git stash使用一则
当在新的分支工作,修改的文件提交到暂存区,这时,切换到其他分之,可能报错,因为米有commit,如果切换到其他分支,暂存区的修改可能丢失,我们可以使用git stash save -a(暂存区) &q ...
- IDEA:Git stash 暂存分支修改的代码
IDEA:Git stash 暂存分支修改的代码 场景:当我们正在master分支开发新功能的时候,突然接到一个任务发现线上出现了一个紧急的BUG需要修复,由于没有打新分支做这部分新需求,这时正做到半 ...
- Git Stash紧急处理问题,需要切分支
在开发过程中,大家都遇到过bug,并且有些bug是需要紧急修复的. 当开发人员遇到这样的问题时,首先想到的是我新切一个分支,把它修复了,再合并到master上. 当时问题来了,你当前正在开发的分支上面 ...
随机推荐
- Java架构师需要掌握的技术栈
- Oracle Set操作
并集合 union/uinon all union 会去重,uinon all 不去重 交集 intersect 差集 minus
- Monument Tour(以前月赛卡住的签到题,今天突然想起拿出来补一补
https://oj.neu.edu.cn/problem/1501 题意:给你矩阵大小和上面的一些点,要你从左到右从一条主路穿过,并且访问这些点,问最短总路线长度. 思路:一开始对于一个点我只算了一 ...
- Cobaltstrike系列教程(三)-beacon详解
0x000--前文 Cobaltstrike系列教程(一)-简介与安装 Cobaltstrike系列教程(二)-Listner与Payload生成 heatlevel 0x001-Beacon详解 1 ...
- linux运维、架构之路-MySQL主从复制
一.MySQL主从复制原理图 MySQL主从复制原理:实现主从复制原理是三个线程完成的,主的I/O线程,备的I/O线程与SQL线程 1.首先主库db01需要开启binlog.授权一个replicat ...
- GEI步态能量图生成
步态能量图生成主要有两步,主要为: 在原始轮廓图上对人的轮廓进行裁剪,在下面制作步态能量图图片叠加以什么为中心位置也是一个问题.一般有两种方式,一种是中心位置为人体宽的一半.另一种是以头顶为中心位置. ...
- Elasticsearch6.5安装&&常见问题与答案解释
ElasticSearch是一个用Java开发的基于Lucene的搜索服务器.它可以提供一个分布式多用户能力的全文搜索引擎,基于RESTfulweb接口.现阶段它主要为Apache许可条款下的开放源码 ...
- P哥的桶(线段树+线性基)
https://www.luogu.org/problem/P4839 题目: 有两个操作 1 a b 在a的位置添加b数值 (注意一个位置可以有多个值) 2 a b : 在 a到b的范围任取任意 ...
- Uva 1471 Defense Lines(LIS变形)
题意: 给你一个数组,让你删除一个连续的子序列,使得剩下的序列中有最长上升子序列, 求出这个长度. 题解: 预处理:先求一个last[i],以a[i]为开始的合法最长上升子序列的长度.再求一个pre[ ...
- 生产环境下,oracle不同用户间的数据迁移。第一部分
:任务名称:生产环境下schema ELON数据迁移至schema TIAN ######################################## 测试一:测试参数 数据泵数据导出:exp ...