-
Sometimes you want to work on more than one CL at once (say, you have a CL
-posted for review and want to work on something else). For each CL that you
-want to work on, just use git new-branch <branchname>.
-
Once you start to have more than one CL at a time, it can be easy to lose your
-bearings. Fortunately, depot_tools has two tools to help you out:
-
-
-
$ git map
-* 7dcfe47 (frozen_changes) 2014-03-12 ~ FREEZE.unindexed
-* 4b0c180 2014-03-12 ~ modfile
-* 59a7cca 2014-03-12 ~ a deleted file
-* 6bec695 (origin/master) 2014-03-11 ~ Add neat feature <(frozen_changes)
-* d15a38a 2014-03-11 ~ Epic README update
-* d559894 (master) 2014-03-11 ~ Important upstream change
-| * 9c311fd (cool_feature) 2014-03-11 ~ Respond to CL comments
-| | * 2a1eeb2 (subfeature) 2014-03-11 ~ integrate with CoolService
-| | * d777af6 2014-03-11 ~ slick commenting action
-| |/
-| * 265803a 2014-03-11 ~ another improvement <(subfeature)
-| * 6d831ac (spleen_tag) 2014-03-11 ~ Refactor spleen
-| * 82e74ab 2014-03-11 ~ Add widget
-|/
-* d08c5b3 (bogus_noparent) 2014-03-11 ~ Wonderful beginnings <(cool_feature)
-
-
-
-
-
$ git map-branches
-origin/master
- cool_feature
- subfeature
- frozen_changes *
- master
-
-
--
-git-map(1)
-
--
-
- This tool shows you the history of all of your branches in a pseudo-graphical
- format. In particular, it will show you which commits all of your branches
- are on, which commit you currently have checked out, and more. Check out the
- doc for the full details.
-
-
--
-git-map-branches(1)
-
--
-
- This tool just shows you which branches you have in your repo, and thier
- upstream relationship to each other (as well as which branch you have checked
- out at the moment).
-
-
-
-
Additionally, sometimes you need to switch between branches, but you’ve got work
-in progress. You could use git-stash(1), but that can be tricky to
-manage because you need to remember which branches you stashed what changes on.
-Helpfully depot_tools includes two tools which can greatly assist in case:
-
git-freeze(1) allows you to put the current branch in 'suspended
-animation' by committing your changes to a specially-named commit on the top of
-your current branch. When you come back to your branch later, you can just run
-git-thaw(1) to get your work-in-progress changes back to what they were.
-
Another useful tool is git-rename-branch(1). Unlike git branch -m <old>
-<new>, this tool will correctly preserve the upstream relationships of your
-branch compared to its downstreams.
-
Finally, take a look at git-upstream-diff(1). This will show you the
-combined diff for all the commits on your branch against the upstream tracking
-branch. This is exactly what git cl upload will push up to code review.
-Additionally, consider trying the --wordwise argument to get a colorized
-per-word diff (instead of a per-line diff).
-