I am trying to add gradle.properties
like rest but still changes that files changes are showing in git status.
Is there any other way to add files in git-ignore
using android studio.
I am trying to add gradle.properties
like rest but still changes that files changes are showing in git status.
Is there any other way to add files in git-ignore
using android studio.
You should use git rm
to untrack the gradle.properties
file first.
git rm --cached gradle.properties
git commit -m "Remove gradle.properties"
Then add the following line to your project .gitignore
file
gradle.properties
Commit and push that and any new changes to this file should not be tracked.
It seems you already added this file to repo, and then you want to ignore it. In this case your file exists in Index/Staging area so git is showing it into changed file list.
So you need to remove this file from Index/Staging area, to do so you just need to clean git cache. Execute below command
git rm --cached gradle.properties
Read more details about Untrack files already added to git repository based on .gitignore
Simplest way use gitignore plugin and just right click the file which you want to hide and and you'll see add to gitignore option, select it and its done.