Source Control Tools

Working with Android code requires using Git (an open-source version control system) and Repo (a Google-built repository management tool that runs on top of Git). See Common Source Control Tasks for a summary of regular actions, such as uploading changes for review.

Git

Git is designed to handle large projects that are distributed over multiple repositories. Android uses Git for local operations such as local branching, commits, diffs, and edits. One of the challenges in setting up the Android project was figuring out how to best support the outside community—from the hobbyist community to large OEMs building mass-market consumer devices. We wanted components to be replaceable, and we wanted interesting components to have a life of their own outside of Android. We first chose a distributed revision control system, then narrowed it down to Git.

For more details on Git, refer to Git Documentation.

Repo

Repo unifies Git repositories when necessary, performs uploads to the Gerrit revision control system, and automates parts of the Android development workflow. Repo isn't meant to replace Git, only to make it easier to work with Git in the context of Android. The repo command is an executable Python script that you can put anywhere in your path. In working with the Android source files, you use Repo for across-network operations. For example, with a single Repo working directory.

In most situations, you can use Git instead of Repo, or mix Repo and Git commands to form complex commands. However, using Repo for basic across-network operations makes your work much simpler. For more details on Repo, see the Repo Command Reference and Repo README.

Other tools

Gerrit is a web-based code review system for projects that use Git. Gerrit encourages more centralized use of Git by allowing all authorized users to submit changes, which are automatically merged if they pass code review. In addition, Gerrit makes reviewing easier by displaying changes side by side in the browser and enabling inline comments.

Android Studio is the official integrated development environment (IDE) for Android application development.