Git is powerful. To tell you how powerful it just compare it with Mjolnir
But there are always some files which are being tracked in the versioning event if it is not used for us.
Let us take an example:
In the above image we can see some of the folder like build, idea are being tracked.
We can simply remove if from being tracked by few commands.
Add .gitignore plugin in you android studio.
Here is sample .gitignore file took from community.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#built application files *.apk *.ap_ # files for the dex VM *.dex # Java class files *.class # generated files bin/ gen/ # Local configuration file (sdk path, etc) local.properties # Windows thumbnail db Thumbs.db # OSX files .DS_Store # Eclipse project files .classpath .project # Android Studio *.iml .idea #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. .gradle build/ #NDK obj/ |
Now if you want to untrack the files, Here are the steps you can follow.
- Update the .gitignore file
- commit pending changes
- Execute following git command.
1 2 3 |
git rm -r --cached . git add . git commit -am "Remove ignored files" |
Hope that fix your git tracking problem.
Happy coding !
REFERENCE: