diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-05-06 17:51:09 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-05-06 17:51:09 +0200 |
commit | bb5c734d7445097e94c4a602f5ce066a836dbead (patch) | |
tree | f7c3a85f2d2d3af62561f1ef6c3cebe90e388b36 /Ignoring a file that is already committed.md | |
parent | 50626752711b563185eda78ba25c145079111d14 (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.md | 14 |
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" +``` |