What is the syntax for ignoring a directory in Git?

When I want to add the whole directory to my .gitignore, what is the syntax? The ignore directory is in my root directory.

Should it be:

1) directory-to-ignore

2) directory-to-ignore/

3) directory-to-ignore/*

+5
source share
1 answer

just add the directory to .gitigore, for example:

.gitignore file:

directory-to-ignore/

therefore parameter 2 is correct

+7
source

All Articles