I'm looking for to exclude a file form versioning. I see the "add" to vcs button on a file but i doesn't find the "untrack" or "ignore" button like in eclipse.I tried to exclude folder .idea/. I tired to edit gitignore manualy and the ignore file button but nothing works. Any ideas ?
Thanks thomas
Android Studio > Preferences... In the Preferences window, select Version Control and under Directory choose VCS dropdown to be <none> Don't forget to click "Apply" in the general Preferences buttons at the bottom.
You can remove tracked files from vcs manually using "Terminal" tab in Android Studio or Git Bash console. To untrack ignored files you should: 1) Make sure the files you want to ignore are properly listed in .gitignore 2) Commit pending changes (important!)
In this directory delete .android, .AndroidStudio and any analogous directories with versions on the end, i.e. AndroidStudio1.2, as well as .gradle and .m2 if they exist. Then go to %APPDATA% and delete the JetBrains folder. After deleting all these folders, go to C:\Program Files and delete the Android folder.
In the console, we would use the git add command. But we can do this right from within Android Studio. Select the Unversioned Files drop-down in the Local Changes tab, right-click and go to Git > Add or use Control-Alt-A. Remember that selecting the root folder will add everything inside it to the staging area.
You can remove tracked files from vcs manually using "Terminal" tab in Android Studio or Git Bash console.
To untrack ignored files you should:
1) Make sure the files you want to ignore are properly listed in .gitignore
2) Commit pending changes (important!)
3) Execute commands
git rm -r --cached .
git add .
4) And then commit again:
git commit -am "Remove ignored files"
These steps will remove all the items from Git Index and then update it again, while respecting git ignores.
The reason for commiting pending changes at step 2 is that if the rm is part of another commit it doesn't work as expected.
Check more information in comments here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With