Juninho Chr Juninho Chr - 1 year ago 75
Git Question

.gitignore is ignoring other directories with the same name

I have a problem in my .gitignore.
I want it to just ignore the 'vendor/' directory, but it is ignoring all directories with that name.

Below is my .gitignore:


Below is the result of my 'git status':

Changes not staged for commit:
   (use "git add <file> ..." to update what will be submitted)
   (use "git checkout - <file> ..." to discard changes in working directory)

modified: .gitignore

Not monitored files:
   (use "git add <file> ..." to include what will be submitted)


It is also ignoring 'src/vendor', I do not want that to happen, I want it to ignore 'vendor/'

Answer Source

From the docs for Git Ignore

A leading slash matches the beginning of the pathname. For example, /*.c matches cat-file.c but not mozilla-sha1/sha1.c.

Try changing vendor/ to /vendor/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download