guisantogui
guisantogui

Reputation: 4136

*.aar files been ignored by git

I want to push my *.aar files to git but, git is no allowing that, here goes my folder structure:

#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/

Here goes the second git ignore:

#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/

And inside aar folder are my files, but they never appear. Ideas? Thanks!

Upvotes: 1

Views: 938

Answers (1)

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

You could use the following to check which rule is excluding a file:

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

Also, note that, including a subdirectory after excluding its parent is NOT possible. From https://git-scm.com/docs/gitignore:

An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, "!important!.txt".

However, not all hope is lost. Take a look at Exclude git ignore on one particular directory inside an already gitignored directory

Upvotes: 1

Related Questions