I am somewhat confused, I noticed that upon setting up my first Git repository in Android Studio all of the correct files to ignore were automatically added to the Project's Settings under Settings > Version Control > Ignored Files.
This appeared to be magic, I never told it what to ignore. Moreover, there is no .gitignore file in any directory of my project as I'm used to creating.
This being said, I can't get my second project to automatically add ignored files, and really, I just want to use the simple .gitignore method.
Does anyone know how to override Android Studio's ignored files list and simply use a .gitignore instead? I'd like the ease of copying my .gitignore to all other projects I make, it does not appear you can copy Settings > Version Control > Ignored Files.
Thank you for commenting on how I can just use .gitignore.
The . gitignore file's purpose is to prevent everyone who collaborates on a project from accidentally commiting some common files in a project, such as generated cache files. Therefore you should not ignore .
If you already git add ed some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached on them. git rm --cached file_name. ext wroks fine for me to update gitignore for one file.
Excluding local files without creating a .Use your favorite text editor to open the file called . git/info/exclude within the root of your Git repository. Any rule you add here will not be checked in, and will only ignore files for your local repository.
Ok to answer my own question. To go back to using .gitignore, do the following:
Doing the above will utilize the .gitignore file instead of Settings > Version Control > Ignored Files to commit the right files.
For me the process was a little easier:
No re-enable VCS required! I'm working with a GitRepo, which is extremely inconvient to do re-enabling VCS. The steps helped.
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