ignore all _notes directories with GIT
Asked Answered
G

1

7

I need your help: I'm currently working on a web project with another person. I'm using NetBeans to develop the code, while he's using Dreamweaver. We would like to ignore all Dreamweaver _notes directories (these directories contain files produced by Dreamweaver itself). We don't know the exact path of these directories. We can find them at /a/b/c/_notes/f or maybe at /_notes/a/b/c or in tens other places. We tried to add

/_notes/
/nbproject
configs/

and

/_notes
/nbproject
configs/

and also

*_notes*
/nbproject
configs/

to the .gitignore file, but the _notes directories are still tracked. Any suggestions? Thank you in advance!

Gadroon answered 26/2, 2014 at 10:58 Comment(1)
If you have already added them, you need to remove them with git rm -r --cached _notesQuizmaster
P
16

The correct answer is

_notes/

That is, ignore all things named _notes that are directories (hence the trailing slash).

edit: I have just seen that you say that directories are still tracked. You cannot ignore something that is already tracked, so what you must do is remove those directories from the index first, and then add the correct line to .gitignore.

To delete the files from git, but not from the filesystem, use:

git rm -r --cached path/to/_notes

If you wish to remove those files from the filesystem too, just drop the --cached option.

Puett answered 26/2, 2014 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.