我想忽略除www目录中的.htaccess文件以外的所有文件。让.gitignore不要忽略顶级目录中的.htaccess文件
我有这样的:
# Ignore everything in this directory
*
# Except this file
!.gitignore
!/www/.htaccess
而且我也试过这样:
# Ignore everything in this directory
*
# Except this file
!.gitignore
!www/.htaccess
当我运行git status
我没有看到的.htaccess为新添加的文件。我曾尝试提交.gitignore文件。依然没有。我错过了明显的东西,不是吗?
更新
我也曾尝试这些:
# Ignore everything in this directory
*
*/\.htaccess
# Except these files
!.gitignore
!www/\.htaccess
和
# Ignore everything in this directory
*
*/.htaccess
# Except these files
!.gitignore
!www/.htaccess
试过。承诺.gitignore,仍然没有看到.htaccess即将到来 – phirschybar