summaryrefslogtreecommitdiff
path: root/Ignoring a file that is already committed.md
diff options
context:
space:
mode:
Diffstat (limited to 'Ignoring a file that is already committed.md')
-rw-r--r--Ignoring a file that is already committed.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/Ignoring a file that is already committed.md b/Ignoring a file that is already committed.md
new file mode 100644
index 0000000..33fdfb2
--- /dev/null
+++ b/Ignoring a file that is already committed.md
@@ -0,0 +1,14 @@
+---
+tags:
+ - git
+---
+This is where `git rm` comes in: If we add `--cached` it removes a file from the git repository (but it will stay in the working directory).
+
+```bash
+$ echo debug.log >> .gitignore
+  
+$ git rm --cached debug.log
+rm 'debug.log'
+  
+$ git commit -m "Start ignoring debug.log"
+```