Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's ignoring the gradle wrapper?

Tags:

git

sourcetree

The setup

New intellij install, new sourcetree installation, new android project, .gitignore has been initialized as:

*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures

The problem

The files in the gradle wrapper, that's gradle/wrapper/gradle.properties and gradle/wrapper/gradle.jar are ignored. And they should be added.

$git add gradle/wrapper/gradle-wrapper.jar 
The following paths are ignored by one of your .gitignore files:
gradle/wrapper/gradle-wrapper.jar

It does not tell me which .gitignore file.

There is no .gitignore in gradle/ or gradle/wrapper.

While I can force this, I don't want to forget in future projects.

like image 375
weston Avatar asked Sep 29 '16 15:09

weston


1 Answers

It sounds like a global ignore file is what’s gumming up the works here. You can use git check-ignore --verbose gradle/wrapper/gradle-wrapper.jar to see exactly what pattern from which file is determining git’s ignore behavior. (Docs on git check-ignore)

I think the best real solution here to make sure that this particular file is not ignored, irregardless of global ignore files or broad rules for ignoring .jar files.

To that end, you can add !/gradle/wrapper/gradle-wrapper.jar to the end of your repo’s .gitignore file. (See the finer points of .gitignore file pattern matching & exclusion at bottom of the docs on .gitignore)

like image 182
roosto Avatar answered Sep 18 '22 10:09

roosto