Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't exclude a folder using .gitignore

Tags:

git

gitignore

I can't exclude files from .idea folder from tracking by git. It is on the same level as .gitignore file and my .gitignore contains:

.idea

and even:

idea

Any advice guys?

like image 403
Eugene Avatar asked Aug 22 '12 16:08

Eugene


People also ask

How do I ignore a folder in Gitignore?

If you want to maintain a folder and not the files inside it, just put a ". gitignore" file in the folder with "*" as the content. This file will make Git ignore all content from the repository.

Can you Gitignore a folder?

gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple . gitignore files.


1 Answers

Append a slash to exclude directories.

.idea/
like image 176
Blake Taylor Avatar answered Oct 02 '22 08:10

Blake Taylor