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.

Recommend me a .gitignore for Android Studio projects

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

Posts: 6503

83

posted 4 months ago

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.

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.

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)