Get Off My Lawn
Get Off My Lawn

Reputation: 36311

Git ignore is ignoring some of the wrong files

I have the following .gitignore file, and whenever I do git add . only the .gitignore file gets added to the repo, what is wrong with my ignore file?

Here is the file:

# Ignore Everything
*

# Except for these:
!.gitignore
!Assets/
!ProjectSettings/

Upvotes: 1

Views: 1265

Answers (1)

SteveTurczyn
SteveTurczyn

Reputation: 36860

The wildcard without a leading slash is excluding everything within all directories.

Here's the sample code that the gitignore documentation suggests (modified for your case)

# exclude everything 
/*
!/Assets
!/ProjectSettings

Here's the documentation site: http://git-scm.com/docs/gitignore

Upvotes: 5

Related Questions