Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore: Ignore one specific directory and that one only [duplicate]

Tags:

git

gitignore

People also ask

How do I Gitignore a specific folder?

gitignore with contents /bin will make it ignore files or folders named bin in th esame folder as the . gitignore . If you want to specify that bin should be a folder, then put a trailing slash. To sum it up, using /bin/ will ignore only the bin folder in the same folder of the .

Can Gitignore ignore folders?

gitignore is a plain text file in which each line contains a pattern for files or directories to ignore. It uses globbing patterns to match filenames with wildcard characters. If you have files or directories containing a wildcard pattern, you can use a single backslash ( \ ) to escape the character.

How do I not ignore a specific file in git?

Git ignore patterns An asterisk is a wildcard that matches zero or more characters. Prepending an exclamation mark to a pattern negates it. If a file matches a pattern, but also matches a negating pattern defined later in the file, it will not be ignored.


I think paths in .gitignore have their root at the project's root, so you may try /bin

EDIT

And by the way, this is normal behaviour from git.