Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #151 from mitechie/update-git-docs
Browse files Browse the repository at this point in the history
- Update the fetch-pr alias per suggestion from Gary to add the +ref.
- Rename the juju-sync to sync-juju to start the trend of available sync-* commands
- Add a sync-trunk which will do a rebase from your develop branch.
- Update docs on how to keep your feature branch up to date based on the latest upstream trunk.
  • Loading branch information
jujugui committed Mar 3, 2014
2 parents 59d3d1c + 7cc561d commit 39052df
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions HACKING.rst
Expand Up @@ -204,12 +204,42 @@ by pulling from the original Juju repository.

# Using the alias from the Helpful aliases section, update your fork with
# the latest code in the juju develop branch.
git juju-sync
git sync-juju

# And start your second feature branch.
git checkout -b {featureBranch2}


Syncing your feature branch with develop (trunk)
-------------------------------------------------

Time to time you have a feature branch you've been working on for several days
while other branches have landed in trunk. To make sure you resolve any
conflicts before submitting your branch, it's often wise to sync your feature
branch with the latest from develop. You can do this by rebasing your branch
with develop.

The recommended pattern would be to

::

# Update your local copy of develop with the latest from the juju branch.
git sync-juju

# Then check back out your feature branch and sync it with your new local
# develop.
git checkout {featureBranch}
git sync-trunk

You should see messages for each landed branch getting rebased into your work.

::

First, rewinding head to replay your work on top of it...
Applying: Created local charm new or upgrade inspector.
Applying: Refactored local charm upload helpers to support multiple service upgrades


Helpful Git tools and aliases
=============================

Expand Down Expand Up @@ -243,7 +273,7 @@ documentation to make working with the Juju Gui easier.
# Bring down the pull request number from the remote specified.
# Note, the remote that the pull request is merging into may not be your
# origin (your github fork).
fetch-pr = "!f() { git fetch $1 refs/pull/$2/head:refs/remotes/pr/$2; }; f"
fetch-pr = "!f() { git fetch $1 +refs/pull/$2/head:refs/remotes/pr/$2; }; f"

# Make a branch that merges a pull request into the most recent version of the
# trunk (the "juju" remote's develop branch). To do this, it also updates your
Expand All @@ -257,8 +287,10 @@ documentation to make working with the Juju Gui easier.
# Update your local develop branch with the latest from the juju remote.
# Then make sure to push that back up to your fork on github to keep
# everything in sync.
juju-sync = "!f() { git checkout develop && git pull juju develop && git push origin develop; }; f"
sync-juju = "!f() { git checkout develop && git pull juju develop && git push origin develop; }; f"

# Rebase develop (trunk) into the current feature branch.
sync-trunk = rebase develop

Working with a Real Juju
========================
Expand Down

0 comments on commit 39052df

Please sign in to comment.