summaryrefslogtreecommitdiff
path: root/Ignoring a file that is already committed.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-05-06 17:51:09 +0200
committerJasper Ras <jras@hostnet.nl>2025-05-06 17:51:09 +0200
commitbb5c734d7445097e94c4a602f5ce066a836dbead (patch)
treef7c3a85f2d2d3af62561f1ef6c3cebe90e388b36 /Ignoring a file that is already committed.md
parent50626752711b563185eda78ba25c145079111d14 (diff)
vault backup: 2025-05-06 17:51:09
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"
+```