popiandro
popiandro

Reputation: 327

Avoiding .gitignore on one folder

I have a .gitignore file on my repository to prevent uploading some files.

But I want to have a single folder inside this repository where all kind of files are allowed.

How can I scape the gitignore on that folder?

Upvotes: 0

Views: 60

Answers (1)

Jay
Jay

Reputation: 3950

You can negate patterns in .gitignore, causing otherwise excluded files to be included.

!folderX/**/*

A line like this in .gitignore will "unexclude" all files in folderX and its subfolders.

Note: The .gitignore file is parsed from top to bottom. Add this line at the end.
Any rule that comes after this line can override its effect.

Upvotes: 2

Related Questions