git unstage
2024-09-25 00:28:25
https://stackoverflow.com/questions/6919121/why-are-there-2-ways-to-unstage-a-file-in-git
git rm --cached <filePath>
does not unstage a file, it actually stages the removal of the file(s) from the repo (assuming it was already committed before) but leaves the file in your working tree (leaving you with an untracked file).
git reset -- <filePath>
will unstage any staged changes for the given file(s).
That said, if you used git rm --cached
on a new file that is staged, it would basically look like you had just unstaged it since it had never been committed before.
最新文章
- Spring 4 使用Freemarker模板发送邮件&;添加附件
- 让/etc/profile文件修改后立即生效
- iOS架构师之路:慎用继承
- Windows内核原理系列01 - 基本概念
- 【腾讯Bugly干货分享】深入源码探索 ReactNative 通信机制
- [转]CPU的位数与操作系统的位数的区别
- gets(),fgets()的作用机制探究
- nodejs:csv模块解析
- 【转载】Visual Studio 2015 for Linux更好地支持Linux下的开发
- ARM1138@库函数速查
- C#——System.Diagnostics.Process.Start的妙用
- sqoop 操作从hdfs 导入到mysql中语句
- 站在Web3.0 理解IPFS是什么
- 屏蔽F12审查元素,禁止使用右键菜单
- Ajax请求中的async:false/true的作用[转]
- JavaScript(数据类型、字符串操作)
- android studio的汉化 教程 及解析
- python3 post方式上传文件。
- Extjs Column布局常见问题及解决方法
- Winform 常用的方法