• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Recommend me a .gitignore for Android Studio projects

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Android Studio version is 2.1.2.

I don't want to ignore stuff and find out the hard way that I'm breaking my repo, but sometimes all I do is open up my project and a "git status" shows changed /.idea files. Very annoying.

I just use command line git, because it's better for me. I change working locations a lot, so important to maintain working repo.

What's your .gitignore look like?
Saloon Keeper
Posts: 10308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch, Oscar!

I don't really know what files you should ignore for Android projects, but in general it's not such a problem to tweak your .gitignore as you go.

Before you make a commit, add all the changes you want to make to the staging area, and then use "git status" to see which files are going to be commited. If there are any files, folders or filetypes in there that you don't want to commit at any time, you can add them to your .gitignore and then remove those files from your staging area again.

Note that if there are already files in your repo that you want to ignore, you need to remove them from your repo first.

Make sure to commit changes to your .gitignore file, then it's easy to maintain the repository across different clones.
Posts: 11
Spring AngularJS Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Oscar,

The .gitignore file, as you might know, may vary from your project requirements as well from the IDE you are using.

A while ago I found this helpful repository on github that contains "templates" on the files you can ignore depending on the language you're working, as well as for any IDE (i.e: IntelliJ, Eclipse, etc)

Hope this might be of help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!