Lines Matching full:repo
1 page.title=Using Repo and Git
4 <p>To work with the Android code, you will need to use both Git and Repo.<br></p>
7 <li><i>Repo</i>
8 is a tool that we built on top of Git. Repo helps us manage the many Git repositories, does the uploads to our <a href="http://review.source.android.com/">revision control system</a>
9 , and automates parts of the Android development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repocommand is an executable Python script that you can put anywhere in your path.<i><br><br></i>
10 In working with the Android source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory.
22 In most situations, you can use Git instead of Repo, or mix Repo and Git
23 commands to form complex commands. Using Repo for basic across-network
28 The task list below shows a summary of how to do common Repo and Git tasks.
33 Installing Repo <br></h3>
34 $ curl http://android.git.kernel.org/repo ~/bin/repo <div>$ chmod a+x ~/bin/repo</div>
37 $ repo init-u git://android.git.kernel.org/platform/manifest.git <br><br><h3>
40 To synchronize the files for all available projects:<br>$ repo sync <br><br>To
41 synchronize the files for selected projects:<br>$ repo sync <i>project1
49 <div><img src="{@docRoot}images/git-repo-0.png">
54 To start a topic branch using Repo:<br>$ repo start <i>branchname</i>
55 <br><br>To verify that your new branch was created:<br>$ repo status <br><br><h3>
58 To assign the branch to a particular project:<br>$ repo start <i>branch</i>
61 <br><br>To see a list of existing branches:<br>$ git branch <br>or...<br>$ repo branches <br><br>The name of the current branch will be preceded by an asterisk.<br><br></div>
64 A bug might be causing repo sync to reset the local topic branch. If git branch shows * (no branch) after you run repo sync, then run git checkoutagain.<br></div>
68 To list the state of your files:<br>$ repo status <br><br>To see uncommitted edits:<br>$ repo diff <br><br>Therepo diffcommand shows every local edit that you have made that would <i>not</i>
74 If a repo sync shows sync conflicts:<br><ol><li>View the files that are unmerged (status code = U).
79 <li>When the rebase is complete start the entire sync again:<br>$ repo syncbionic <i>proj2</i>
88 To update your local working directory after changes are merged in Gerrit:<br>$repo sync <br><br>To safely remove stale topic branches:<br>$ repo prune <br><br><h3>
97 You can use Repo to run the same program across all projects:<br><br>$ repo forall[<i>proj1</i>
109 Repo command reference
111 Repo usage takes the following form:<br>repo <i>command options</i>
112 <br><br>Optional elements are shown in brackets[ ]. Once Repo is installed, you can get information about any command by running <br>repo help <i>command</i>
116 repo init -u <i>url</i>
118 ]<br><br><div>Installs Repo in the current directory. This creates a .repo/ directory that contains Git repositories for the Repo source code and the standard Android manifest files. The .repo/ directory also containsmanifest.xml, which is a symlink to the selected manifest in the .repo/manifests/ directory.<br><br>The -u argument specifies a URL from which to retrieve a manifest repository. For example:<br>$ repo init -u git://android.git.kernel.org/platform/manifest.git <br><br>To select a manifest file within the repository, use the -m option. (If no manifest name is selected, the default is default.xml.)For example:<br>$ repo init -ugit://android.git.kernel.org/platform/manifest.git-m dalkvik-plus.xml <br><br>To specify a revision, that is, a particular manifest-branch, use the -b option. For example:<br>$ repo init -ugit://android.git.kernel.org/platform/manifest.git-b release-1.0<br><br>To see other repo init options, run <br>$ repo help init <br><br><b>Note:</b>
119 For all remaining Repo commands, the current working directory must either be the parent directory of .repo/ or a subdirectory of the parent directory.<br><br></div>
123 repo sync [<i>project-list</i>
124 ]<br><br><div>Downloads new changes and updates the working files in your local environment. After a successful repo sync, the code in specified projects will be up to date with the code in the remote repository.<br><br>You can specify project-list as a list of names or a list of paths to local source directories for the projects:<br>repo sync [<i>proj1</i>
129 ]<br><br>If you run repo sync without any arguments, it will synchronize the files for all the projects.<br><br></div>
130 <p><b>How Repo synchronization works</b>
132 <div>When you run repo sync, this is what happens:<br></div>
133 <ol><li>If the project has never been synchronized, then repo sync is equivalent to git clone. All branches in the remote repository are copied to the local project directory.
135 <li>If the project has already been synchronized once, then repo sync is equivalent to:<br>git remote update <br>git rebase origin/<i>branch</i>
139 <div>The repo sync command also updates the private repositories in the .repo/ directory.<br></div>
143 repo upload [<i>project-list</i>
144 ]<br><br><div>For the specified projects, Repo compares the local branches to the remote branches updated during the last repo sync. Repo will prompt you to select one or more of the branches that have not yet been uploaded for review.<br><br>After you select one or more branches, all commits on the selected branches are transmitted to Gerrit over an SSH connection.You will need to configure an SSH key to enable upload authorization.Visit <a href="http://review.source.android.com/Gerrit#settings,ssh-keys">SSH Keys</a>
145 within the user settings panel to register your public keys with Gerrit.To enable password-less uploads, consider using ssh-agent on your client system.<br><br>When Gerrit receives the object data over its SSH server, it will turn each commit into a change so that reviewers can comment on each commit individually.<br><br>To combine several "checkpoint" commits together into a single commit, use git rebase -i before you run repo upload.<br><br>You can specify project-list as a list of names or a list of paths to local source directories for the projects:<br>repo upload [<i>proj1</i>
150 ]<br><br>If you run repo upload without any arguments, it will search all the projects for changes to upload.<br><br>To make edits to changes after they have been uploaded, you should use a tool likegit rebase -ior git commit --amend to update your local commits.<br><br>After your edits are complete:<br></div>
153 <li>Use repo upload --replace <i>proj1</i>
159 <div># Replacing from branch foo <br>[ 3021 ] 35f2596c Refactor part of GetUploadableBranches to lookup one specific...<br>[ 2829 ] ec18b4ba Update proto client to support patch set replacments <br>[ 3022 ] c99883fe Teach 'repo upload --replace' how to add replacement patch se...<br># Insert change numbers in the brackets to add a new patch set.<br># To create a new change record, leave the brackets empty.<br><br>After the upload is complete the changes will have an additional Patch Set (e.g. Patch Set 2, Patch Set 3, ...).<br></div>
163 repo diff [<i>project-list</i>
164 ]<br><br><div>Shows changes between commit and working tree.<br><br>You can specify project-list as a list of names or a list of paths to local source directories for the projects:<br>repo diff [<i>proj1</i>
172 repo download <i>target</i>
174 <br><br><div>Downloads the specified change into the specified local directory. (Added to Repo as of version 1.0.4.)<br><br>For example, to download <a href="http://review.source.android.com/1241">change 1241</a>
175 into your platform/frameworks/base directory:<br>$ repo download platform/frameworks/base 1241<br><br>A"repo sync"should effectively remove any commits retrieved via "repo download".Or, you can check out the remote branch; e.g., "git checkout m/master".<br><br><b>Note:</b>
177 and when repo download will be able to find it, because changes are actually downloaded off the git://android.git.kernel.org/ mirror farm. There will always be a slight mirroring lag as Gerrit pushes newly uploaded changes out to the mirror farm.
182 repo forall [<i>project-list</i>
189 repo help [<i>command</i>
193 repo prune [<i>project-list</i>
194 ]<br><br><div>Prunes (deletes) topics that are already merged.<br><br>You can specify project-list as a list of names or a list of paths to local source directories for the projects:<br>repo prune [<i>proj1</i>
203 repo start <i>newbranchname</i>
207 specifies which projects will participate in this topic branch. You can specify project-list as a list of names or a list of paths to local working directories for the projects:<br>repo start default [<i>proj1</i>
216 repo status [<i>project-list</i>
217 ]<br><br><div>Shows the status of the current working directory. You can specify project-list as a list of names or a list of paths to local source directories for the projects:<br>repo status [<i>proj1</i>
222 ]<br><br>To see the status for only the current branch, run <br>repo status .<br><br>The status information will be listed by project. For each file in the project, a two-letter code is used:<br></div>
265 columns means this is a new file, unknown to Git. After you run git add on this file, repo status will show A-, indicating the file has been added.<br></td>
269 <br>For example, if you edit the file main.py within the appeng project without staging the changes, then repo status might show <br><br>project appeng/<br>-mmain.py <br><br>If you go on to stage the changes to main.py by running git add, then reporepo status might show <br><br>project appeng/<br>-mapp.yaml <br>Mm main.py <br><br></div>
271 Git and Repo cheatsheet
275 <div><img src="{@docRoot}images/git-repo-1.png">
295 Repo and Git resources:
297 <li><a href="http://source.android.com/download/using-repo#TOC-Git-and-Repo-cheatsheet">Git and Repo cheat sheet</a></li>
298 <li><a href="http://source.android.com/download/using-repo">Using Repo and Git</a></li>