I am using smartgit on windows.
I am trying to add some directories in the repo to be ignored.
I am using the following .gitignore, that was recommended for Android Studio android application.
#built application files
# files for the dex VM
# Java class files
# generated files
# Local configuration file (sdk path, etc)
# Windows thumbnail db
# OSX files
# Eclipse project files
# Android Studio
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
you're telling git to skip the
build directory entirely, so it will automatically ignore any files or directory in that path.
generated directory is correctly being ignored.
Now, the only reason (given your gitignore) for
intermediate to be included, is that it was already committed on the repo before it became ignored.
If you want to start ignoring it, you need to remove it first, using
git rm -r --cached build/intermediate
As a bonus, if you want to ignore a directory, but not a subdirectory you can do
Here's a more thorough explanation on the subject: .gitignore exclude folder but include specific subfolder