# Make sure we have the most up-to-date branch sources.
+
+PREREQUISITES
+Before working with branches, you must
+gclient sync --with_branch_heads
+at least once to fetch the branches.
+
+Merge Example
+# Make sure we have the most up-to-date branch sources.
$ git fetch
# Here's the commit we want to 'drover'.
$ git log -n 1 --pretty=fuller
-commit 19b478428049b956b2dc389893c9ed7c05d1b175
+commit 1077c7acbc1f1881d5181f6b1eaf4d0c6cd92543
Author: some.committer <some.committer@chromium.org>
AuthorDate: Thu Apr 10 08:54:46 2014 +0000
Commit: some.committer <some.committer@chromium.org>
@@ -789,8 +796,8 @@ Branch drover_9999 set up to track remote ref refs/branch-heads/9999.
# Now do the 'drover'.
# IMPORTANT!!! Do Not leave off the '-x' flag
-$ git cherry-pick -x 19b478428049b956b2dc389893c9ed7c05d1b175
-[drover_9999 88e74e0] This change needs to go to branch 9999
+$ git cherry-pick -x 1077c7acbc1f1881d5181f6b1eaf4d0c6cd92543
+[drover_9999 1d9c1a1] This change needs to go to branch 9999
Author: some.committer <some.committer@chromium.org>
Date: Thu Apr 10 08:54:46 2014 +0000
1 file changed, 1 insertion(+)
@@ -799,7 +806,7 @@ Branch drover_9999 set up to track remote ref refs/branch-heads/9999.
# That took the code authored by some.commiter and commited it to the
# branch by branch.maintainer (us).
$ git log -n 1 --pretty=fuller
-commit 88e74e0f2540eba7bc7bd4d6adb4b0d7923c9488
+commit 1d9c1a1b768f2248c884495f4d47739c2ff249f7
Author: some.committer <some.committer@chromium.org>
AuthorDate: Thu Apr 10 08:54:46 2014 +0000
Commit: branch.maintainer <branch.maintainer@chromium.org>
@@ -807,20 +814,58 @@ CommitDate: Thu Apr 10 09:11:36 2014 +0000
This change needs to go to branch 9999
- (cherry picked from commit 19b478428049b956b2dc389893c9ed7c05d1b175)
+ (cherry picked from commit 1077c7acbc1f1881d5181f6b1eaf4d0c6cd92543)
# Looks good. Ship it!
$ git cl upload
-# Get LGTM or TBR.
+# Wait for LGTM or TBR it.
$ git cl land
# Or skip the LGTM/TBR and just 'git cl land --bypass-hooks'
+
+Revert Example
+# Make sure we have the most up-to-date branch sources.
+$ git fetch
+
+# Checkout the branch with the change we want to revert.
+$ git checkout -b drover_9999 branch-heads/9999
+Branch drover_9999 set up to track remote ref refs/branch-heads/9999.
+
+# Here's the commit we want to revert.
+$ git log -n 1
+commit aca17ebfc070673e98afb6d36f6028eae6b0b8ca
+Author: some.committer <some.committer@chromium.org>
+Date: Thu Apr 10 08:54:46 2014 +0000
+
+ This change is horribly broken.
+
+# Now do the revert.
+$ git revert aca17ebfc070673e98afb6d36f6028eae6b0b8ca
+
+# That reverted the change and committed the revert.
+$ git log -n 1
+commit d27f8f3fd56621c5e3a92cb5e64100e2bc2137a2
+Author: branch.maintainer <branch.maintainer@chromium.org>
+Date: Thu Apr 10 09:11:36 2014 +0000
+
+ Revert "This change is horribly broken."
+
+ This reverts commit aca17ebfc070673e98afb6d36f6028eae6b0b8ca.
+
+# As with old drover, reverts are generally OK to commit without LGTM.
+$ git cl upload -r some.committer@chromium.org --send-mail
+$ git cl land --bypass-hooks
+
+
+
+