Skip to content

Collaborating on Projects with Git

Nathan Esquenazi edited this page Jul 28, 2014 · 18 revisions

Overview

This is a guide focused on collaborating on Android projects together with teammates using Git.

Setup Git

First, you need to properly setup git for your project:

git init

Next, setup a .gitignore file at the root with the contents from this file to ignore files that shouldn't be shared between collaborators.

Next, make sure you have setup a repository on github and then add that repo as the origin:

git remote add origin git@github.com:myusername/reponame.git

You can now add the initial files to git using the SourceTree / Github client or by typing:

git add .
git commit -am "Initial commit"

and now go ahead and push the code to Github with:

git push origin master

You can also use your favorite Git GUI (for example SourceTree) to do a lot of this process as well.

Importing Shared Projects

When first importing a project generated by another person run the following in Eclipse:

Package Explorer -> Right click the project -> "Android Tools" -> "Fix Project Properties"
Project -> Clean

Then review this detailed import troubleshooting guide if you are still running into problems while compiling. This likely involves having to cleanup the dependencies for the project.

Map Access Across Computers

Often when collaborating on a project with others, you need to have the maps work across multiple computers. The problem is that the map key fingerprint is different from computer to computer and thus by default the maps will only work on the computer that was used to generate the key.

The simplest fix is described in detail within this stackoverflow post but in short you can get the debug.keystore from one of the team members, check that into git and then instruct other team members to replace their debug.keystore file with the one from repository. See also this link and this guide.

Finding these guides helpful?

We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.

Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.

Clone this wiki locally