Git-newbie here. How can I ignore the tracking of files in git, especially for folder. I tried to use git rm but it was manual works
Asked
Active
Viewed 34 times
-5
-
1Does this answer your question? [How can I make Git "forget" about a file that was tracked, but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-can-i-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitign) – evolutionxbox Jun 02 '22 at 21:44
-
In general `git rm FILENAME` is the right way to make it stop tracking a file. "it was manual works" is not a good description of the problem you are having. I suggest you try asking again but this time copy and paste a shell session into your question that shows what you tried and what problem you are having. – David Grayson Jun 02 '22 at 21:51
1 Answers
1
You can create a file named .gitignore inside your project directory and add the folders/files that not intended to be tracked.
For files, only include the filename, such as foo.py
For folders, use "/" as prefix and suffix, such as /foo/
One item per line

adrian
- 98
- 1
- 7
-
More info about the syntax and the gitignore meachanism can be found here: https://git-scm.com/docs/gitignore – Jay Jun 03 '22 at 10:59