Skip to content

Commit adca84e

Browse files
committed
updating notes on gitignoring file configurations
1 parent 521d569 commit adca84e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Git-and-Github/gitignore-file-configuration.md

+22
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,25 @@ node_modules/
5050

5151
Source - https://stackoverflow.com/a/1470664/1902852
5252

53+
---
54+
55+
### Important things to do after you change your .gitignore file and put new folder to the ignore list, which was already pushed to remote.
56+
57+
If you already have a file checked in, and you want to ignore it, Git will not ignore the file if you add a rule later. In those cases, you must untrack the file first, by running the following command in your terminal:
58+
59+
```
60+
git rm --cached
61+
62+
```
63+
64+
So if you want add to ignore some directories in your local repository (which already exist) after editing .gitignore you want to run this on your root dir
65+
66+
```
67+
git rm --cached -r .
68+
git add .
69+
70+
```
71+
It will basically 'refresh' your local repo and unstage ignored files.
72+
73+
74+
#### [Source](https://stackoverflow.com/a/30210030/1902852)

0 commit comments

Comments
 (0)