I have an Android library , and for some reason, the files and folders that I specified in my .gitignore are not ignored.
.gitignore
I tried to modify my .gitignore as well as the following these steps , but that doesnβt change anything.
Here is my top level .gitignore (which can also be found in the GitHub repository ):
# Gradle files .gradle/ build/ */build/ # Local configuration file (sdk path, etc) local.properties # IntelliJ *.iml /.idea
A module with a build folder that is not ignored has the following .gitignore :
build
/build/
I am not sure why the build directory is not ignored, as it is ignored in the sample application module , and in the top-level directory .
In addition, I actually made changes to some of the files in the build directory when I updated versions of my library, if that was important.
This stack overflow answer helped me solve my problem.
Here is part of the answer:
First make any code changes , and then run this command:git rm -r --cached .This removes any modified files from the index (staging area) and then runs:git add .Commit it:git commit -m ".gitignore is now working"
First make any code changes , and then run this command:
git rm -r --cached .
This removes any modified files from the index (staging area) and then runs:
git add .
Commit it:
git commit -m ".gitignore is now working"
You have to remove the first / lower level gitignore before building, then it will work. In addition, at the top level, you only need the following: build/ , and then a higher level of gitignore is not required.
/
build/
Source: https://habr.com/ru/post/1246692/More articles:Error migrating new user model - djangotvOS video: header metadata trimmed, work size too small - iosSubscribe to a free trial version of IAB - androidHow to use an implicit Scala class in Java - javaJQuery datatables operations based on row index - jqueryInputConnection.finishComposingText () NullPointerException - androidgit .gitignore without ignoring previously tracked files - gitHow to update id and html element name inside div element? - javascriptHow to get dynamically added values ββfrom a view to a controller in ASP.NET MVC? - jqueryWhat should the async method do if the task is executed conditionally? - c #All Articles