Git不会“看到"ASP.NET MVC4 Web应用程序中的App_Data [英] Git doesn't "see" App_Data in ASP.NET MVC4 web application
问题描述
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.
这是我刚刚创建的新应用程序,并立即初始化了一个存储库.我尝试创建另一个新应用程序(来自Visual Studio 2012),并得到了相同的结果.我还尝试过简单地初始化 git 回购的问题我手动创建的这是我的结果(来自bash提示符):
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):
我正在Windows 7操作系统上运行git版本为1.8.1.2的msysgit.
$ 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...
为什么 git 的问题,而忽略了 App_Data
目录?
Why is git ignoring the App_Data
directory?
推荐答案
Git忽略了App_Data目录,因为它为空.Git基于文件而不是文件夹工作,因此忽略空目录.存储空目录的一种标准方法是将 .gitignore
或 readme
文件放在文件夹中并提交.
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
or readme
file in the folder and commit that.
这篇关于Git不会“看到"ASP.NET MVC4 Web应用程序中的App_Data的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!