This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Recommend me a .gitignore for Android Studio projects

 
Oscar Blank
Greenhorn
Posts: 1
  • 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?
 
Stephan van Hulst
Bartender
Pie
Posts: 6503
83
  • 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.
 
Walter Gómez
Greenhorn
Posts: 11
AngularJS Java Spring
  • 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