Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Tools Using Git for Android Creating a New Repo with Android Studio

Alex Johnson
Alex Johnson
6,067 Points

Which files should I select in "Add Files for Initial Commit"?

When making my first commit I have to choose which files to include. Only one of my activity class files is checked by default (though I have others that were not automatically checked).

Should I check the boxes to include ALL files in my initial commit?

1 Answer

I would, yes. Make certain that the files you are going to change are contained within the initial commit. I have found that the default options sometimes aren't enough. Ensure that the correct folders are included, so your src folder and res folders too. Any place where you may make an addition/amendent or an erroneous deletion!

Hope that helps.

Steve.

I often use the terminal for git matters - that works really well.

So, before your initial commit and assuming you have created a repository locally, I would use git add . or git add -A to add all the files. You can always check what has been added (or what has been updated since your last commit) by typing git status. Once you are happy with that, type git commit -m "Your commit message here" and it'll commit those changes.

Alex Johnson
Alex Johnson
6,067 Points

Thanks for the quick reply, Steve. Seems easiest to include everything, but I don't want to accidentally share private data or passwords. I didn't explicitly include any of that in my app, but I just don't know enough about this stuff to be sure what the best course of action is.

That's a good point, yes. For local git usage, that's not a problem but if you're setting up remote repositories, then I'd check how it copes with API keys etc. Github, for example, doesn't allow free private repos (last time I looked) but a site like BitBucket does - that removes that issue.