mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-24 17:49:36 +01:00
TIL: Removing a file without deleting it from disk
This commit is contained in:
parent
e3efe57c18
commit
20ca9a8e0c
8
git/removing-a-file-without-deleting-it-from-disk.md
Normal file
8
git/removing-a-file-without-deleting-it-from-disk.md
Normal file
@ -0,0 +1,8 @@
|
||||
From Pro Git book:
|
||||
|
||||
> Another useful thing you may want to do is to keep the file in your working tree but remove it from your staging area. In other words, you may want to keep the file on your hard drive but not have Git track it anymore. This is particularly useful if you forgot to add something to your .gitignore file and accidentally staged it, like a large log file or a bunch of .a compiled files. To do this, use the --cached option:
|
||||
```
|
||||
git rm --cached README
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user