aboutsummaryrefslogtreecommitdiff
path: root/en/source/using-repo.html
diff options
context:
space:
mode:
Diffstat (limited to 'en/source/using-repo.html')
-rw-r--r--en/source/using-repo.html91
1 files changed, 56 insertions, 35 deletions
diff --git a/en/source/using-repo.html b/en/source/using-repo.html
index e0298256..9fc473ff 100644
--- a/en/source/using-repo.html
+++ b/en/source/using-repo.html
@@ -23,33 +23,38 @@
<p>Repo usage takes the following form: </p>
-<pre><code>repo <em>&lt;COMMAND&gt;</em> <em>&lt;OPTIONS&gt;</em>
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo <var>&lt;COMMAND&gt; &lt;OPTIONS&gt;</var>
+</pre>
<p>Optional elements are shown in brackets [ ]. For example, many commands take
a project list as an argument. You can specify project-list as a list of names
or a list of paths to local source directories for the projects:</p>
-<pre><code>repo sync [<em>&lt;PROJECT0&gt;</em> <em>&lt;PROJECT1&gt;</em> <em>&lt;PROJECTN&gt;</em>]
-repo sync [<em>&lt;/PATH/TO/PROJECT0&gt;</em> ... <em>&lt;/PATH/TO/PROJECTN&gt;</em>]
-</code></pre>
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">repo sync [<var>&lt;PROJECT0&gt; &lt;PROJECT1&gt; ... &lt;PROJECTN&gt;</var>]</code>
+<code class="devsite-terminal">repo sync [<var>&lt;/PATH/TO/PROJECT0&gt; ... &lt;/PATH/TO/PROJECTN&gt;</var>]</code>
+</pre>
<h2 id="help">help</h2>
<p>Once Repo is installed, you can find the latest documentation starting with a summary of all commands by running:</p>
-<pre><code>repo help
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo help
+</pre>
<p>You can get information about any command by running this within a Repo tree:</p>
-<pre><code>repo help <em>&lt;COMMAND&gt;</em>
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo help <var>&lt;COMMAND&gt;</var>
+</pre>
<p>For example, the following command yields a description and list of options
for the <code>init</code> argument of Repo, which initializes Repo in the
current directory. (See <a href="#init">init</a> for more details.)</p>
-<pre><code>repo help init
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo help init
+</pre>
<h2 id="init">init</h2>
-<pre><code>$ repo init -u <em>&lt;URL&gt;</em> [<em>&lt;OPTIONS&gt;</em>]
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">repo init -u <var>&lt;URL&gt;</var> [<var>&lt;OPTIONS&gt;</var>]
+</pre>
<p>Installs Repo in the current directory. This creates a <code>.repo/</code> directory that contains Git repositories for the Repo source code and the standard Android manifest files. The <code>.repo/</code> directory also contains <code>manifest.xml</code>, which is a symlink to the selected manifest in the <code>.repo/manifests/</code> directory.</p>
<p>Options:</p>
<ul>
@@ -64,9 +69,11 @@ current directory. (See <a href="#init">init</a> for more details.)</p>
</li>
</ul>
<p class="note"><strong>Note:</strong> For all remaining Repo commands, the current working directory must either be the parent directory of <code>.repo/</code> or a subdirectory of the parent directory.</p>
+
<h2 id="sync">sync</h2>
-<pre><code>repo sync [<em>&lt;PROJECT_LIST&gt;</em>]
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo sync [<var>&lt;PROJECT_LIST&gt;</var>]
+</pre>
<p>Downloads new changes and updates the working files in your local environment. If you run <code>repo sync</code> without any arguments, it will synchronize the files for all the projects.</p>
<p>When you run <code>repo sync</code>, this is what happens:</p>
<ul>
@@ -75,10 +82,10 @@ current directory. (See <a href="#init">init</a> for more details.)</p>
</li>
<li>
<p>If the project has already been synchronized once, then <code>repo sync</code> is equivalent to:</p>
-<pre><code>git remote update
-git rebase origin/<em>&lt;BRANCH&gt;</em>
+<pre><code>git remote update
+git rebase origin/<var>&lt;BRANCH&gt;</var>
</code></pre>
-<p>where <code><em>&lt;BRANCH&gt;</em></code> is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.</p>
+<p>where <code>&lt;BRANCH&gt;</code> is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.</p>
</li>
<li>
<p>If the git rebase operation results in merge conflicts, you will need to use the normal Git commands (for example, <code>git rebase --continue</code>) to resolve the conflicts.</p>
@@ -97,9 +104,11 @@ git rebase origin/<em>&lt;BRANCH&gt;</em>
<p><code>-f</code>: proceed with syncing other projects even if a project fails to sync.</p>
</li>
</ul>
+
<h2 id="upload">upload</h2>
-<pre><code>repo upload [<em>&lt;PROJECT_LIST&gt;</em>]
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo upload [<var>&lt;PROJECT_LIST&gt;</var>]
+</pre>
<p>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.</p>
<p>After you select one or more branches, all commits on the selected branches
are transmitted to Gerrit over an HTTPS connection. You will need to
@@ -127,25 +136,32 @@ single commit, use git rebase -i before you run repo upload.</p>
</li>
</ul>
<p>After the upload is complete the changes will have an additional Patch Set.</p>
+
<h2 id="diff">diff</h2>
-<pre><code>repo diff [<em>&lt;PROJECT_LIST&gt;</em>]
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo diff [<var>&lt;PROJECT_LIST&gt;</var>]
+</pre>
<p>Shows outstanding changes between commit and working tree using <code>git diff</code>. </p>
+
<h2 id="download">download</h2>
-<pre><code>repo download <em>&lt;TARGET&gt;</em> <em>&lt;CHANGE&gt;</em>
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo download <var>&lt;TARGET&gt; &lt;CHANGE&gt;</var>
+</pre>
<p>Downloads the specified change from the review system and makes it available in your project's local working directory.</p>
<p>For example, to download <a href="https://android-review.googlesource.com/23823">change 23823</a> into your platform/build directory:</p>
-<pre><code>$ repo download platform/build 23823
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo download platform/build 23823
+</pre>
<p>A <code>repo sync</code> should effectively remove any commits retrieved via <code>repo download</code>. Or, you can check out the remote branch; e.g., <code>git checkout m/master</code>.</p>
<p class="note"><strong>Note:</strong> There is a slight mirroring lag between when a change is visible on
the web in <a href="https://android-review.googlesource.com/">Gerrit</a> and when
<code>repo download</code> will be able to find it for all users, because of replication
delays to all servers worldwide.</p>
+
<h2 id="forall">forall</h2>
-<pre><code>repo forall [<em>&lt;PROJECT_LIST&gt;</em>] -c <em>&lt;COMMAND&gt;</em>
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo forall [<var>&lt;PROJECT_LIST&gt;</var>] -c <var>&lt;COMMAND&gt;</var>
+</pre>
<p>Executes the given shell command in each project. The following additional environment variables are made available by <code>repo forall</code>:</p>
<ul>
<li>
@@ -176,20 +192,25 @@ delays to all servers worldwide.</p>
<p><code>-v</code>: show messages the command writes to stderr. </p>
</li>
</ul>
+
<h2 id="prune">prune</h2>
-<pre><code>repo prune [<em>&lt;PROJECT_LIST&gt;</em>]
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo prune [<var>&lt;PROJECT_LIST&gt;</var>]
+</pre>
<p>Prunes (deletes) topics that are already merged.</p>
+
<h2 id="start">start</h2>
-<pre><code>repo start <em>&lt;BRANCH_NAME&gt;</em> [<em>&lt;PROJECT_LIST&gt;</em>]
+<pre class="devsite-terminal devsite-click-to-copy">repo start <var>&lt;BRANCH_NAME&gt;</var> [<var>&lt;PROJECT_LIST&gt;</var>]
</code></pre>
<p>Begins a new branch for development, starting from the revision specified in the manifest.</p>
-<p>The <code><em>&lt;BRANCH_NAME&gt;</em></code> argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.</p>
-<p>The <code><em>&lt;PROJECT_LIST&gt;</em></code> specifies which projects will participate in this topic branch. </p>
+<p>The <code>&lt;BRANCH_NAME&gt;</code> argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.</p>
+<p>The <code>&lt;PROJECT_LIST&gt;</code> specifies which projects will participate in this topic branch. </p>
<p class="note"><strong>Note:</strong> "." is a useful shorthand for the project in the current working directory.</p>
+
<h2 id="status">status</h2>
-<pre><code>repo status [<em>&lt;PROJECT_LIST&gt;</em>]
-</code></pre>
+<pre class="devsite-terminal devsite-click-to-copy">
+repo status [<var>&lt;PROJECT_LIST&gt;</var>]
+</pre>
<p>Compares the working tree to the staging area (index) and the most recent commit on this branch (HEAD) in each project specified. Displays a summary line for each file where there is a difference between these three states.</p>
<p>To see the status for only the current branch, run <code>repo status</code>. The status information will be listed by project. For each file in the project, a two-letter code is used:</p>
<p>In the first column, an uppercase letter indicates how the staging area differs from the last committed state.</p>