I was musing about whether to include the App_Data
directory (of my ASP.NET MVC4 web application) in its git repository when I noticed that it is already being ignored, even when there is no .gitignore
file at all.
This is a new application that I just created and immediately initialized a repo. I tried creating another new application (from Visual Studio 2012), and got the same result. I also tried simply initializing a git repo in a directory that I manually created. Here are my results (from bash prompt):
I'm on Windows 7 running msysgit with git version 1.8.1.2.
$ mkdir TEST
$ cd TEST
$ mkdir App_Data
$ ls
App_Data/
$ git init
Initialized empty Git repository in c:/Projects/TEST/.git/
$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
$ echo wtf...
Why is git ignoring the App_Data
directory?
Please mark above post as answer if that solved your issue.
I was having same problem, my repo was ignoring App_Data folder, where my database file (.sdf) was located. I tried adding .gitignore and it still did not work. I had to sync .sdf file so I did this,
Now your App_Data and its files/sub-directories should be visibe in repo.
Git is ignoring the App_Data directory because it is empty. Git works based on files rather than folders so ignores empty directories. A standard way to store an empty directory is to place a
.gitignore
orreadme
file in the folder and commit that.