git 非常用命令笔记
来源:互联网 发布:中国流行音乐发展知乎 编辑:程序博客网 时间:2024/06/07 01:13
1. git临时存储现有变更 git stash
git stash 存储现有变更
git stash apply 读取最新存储的变更
git stash list 查看存储变更列表
$ git stash list
stash@{0}: WIP on master: 049d078 added the index file
stash@{1}: WIP on master: c264051 Revert "added file_size"
stash@{2}: WIP on master: 21d80a5 added number to log
git stash apply stash@{2} 读取特定的存储
git stash drop stash@{0} 删除特定的存储
更多参考:
https://git-scm.com/book/zh/v1/Git-%E5%B7%A5%E5%85%B7-%E5%82%A8%E8%97%8F%EF%BC%88Stashing%EF%BC%89
2.git清空所有变更
git reset --hard # removes staged and working directory changes## !! be very careful with these !!## you may end up deleting what you don't want to## read comments and manual.git clean -f -d # remove untrackedgit clean -f -x -d # CAUTION: as above but removes ignored files like config.git clean -fxd :/ # CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory)
http://stackoverflow.com/questions/1090309/git-undo-all-working-dir-changes-including-new-files
3. git 恢复单个文件
git checkout HEAD -- my-file.txt
0 0
- git 非常用命令笔记
- git常用命令-Git学习笔记
- Git/SVN 常用命令笔记
- Git常用命令笔记
- Git 常用命令笔记
- Git常用命令笔记
- 【笔记】git常用命令
- git常用命令学习笔记
- Git 常用命令和笔记
- git 常用命令笔记
- git 常用命令笔记
- git 常用命令笔记
- Git学习笔记-常用命令
- Git常用命令笔记
- Git 常用命令 笔记
- git 常用命令学习笔记
- Git学习笔记--常用命令
- git常用命令学习笔记
- 默认库“library”与其他库的使用冲突;请使用 /NODEFAULTLIB:library LNK4098 的解决办法
- CentOS更换yum mirror
- 调用startAcyivityForResult后立即执行onActivityResult
- iOS开发-UITextField(输入框)用法详解
- 2015从BAT看中国互联网
- git 非常用命令笔记
- android java.lang.NoSuchFieldError: R$id.xxx
- Android中的抽象类和接口实践
- 与二进制中1的位数有关题目
- SpringMVC表单标签简介
- Boost 学习之算法篇 is_sorted
- XMLHttpRequest 对象解析
- DateTime操作;
- maven仓库--私服(Nexus的配置使用)