* .aar文件被git

时间:2016-10-14 16:26:04

标签: android git version-control gitignore

我想把我的* .aar文件推送到git但是,git是不允许的,这里是我的文件夹结构:

#Main .gitignore


# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

这是第二个git忽略:

#earth/.gitignore   <-- This is the directory where gitignore file is
!build/

3RD:

#earth/build/.gitignore   <-- This is the directory where gitignore file is
!outputs/

4TH

#earth/build/outputs/.gitignore   <-- This is the directory where gitignore file is
!aar/

在aar文件夹中是我的文件,但它们从未出现过。想法? 谢谢!

1 个答案:

答案 0 :(得分:0)

您可以使用以下内容检查哪个规则排除了文件:

$ git check-ignore -v path-to-an-aar

另外,请注意,在排除其父级之后包含子目录是不可能的。来自https://git-scm.com/docs/gitignore

  

可选前缀“!”否定了这种模式;之前模式排除的任何匹配文件将再次包含在内。 如果排除该文件的父目录,则无法重新包含文件。由于性能原因,Git不会列出排除的目录,因此所包含文件的任何模式都无效,无论如何他们被定义的地方。在第一个“!”前放一个反斜杠(“\”)对于以文字“!”开头的模式,例如“!important!.txt”。

然而,并非所有希望都失去了。看看Exclude git ignore on one particular directory inside an already gitignored directory

相关问题