This is great. I'll give this a shot. Thanks Mark. <div><br></div><div>Everett<br><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 3:14 PM, Mark McLoughlin <span dir="ltr"><<a href="mailto:markmc@redhat.com" target="_blank">markmc@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, 2012-06-05 at 14:43 -0600, Everett Toews wrote:<br>
> Hi All,<br>
><br>
> If you have a relatively long-lived topic branch, what's the best way to<br>
> remotely save changes?<br>
><br>
> If you wanted to fork an OpenStack project on github, it would work<br>
> something like:<br>
><br>
> 1. Fork the project on <a href="http://github.com" target="_blank">github.com</a> to your own account<br>
> 2. Clone the project locally<br>
> 3. Add a remote branch to your local repo that points to the origin project<br>
> repo you forked from<br>
> 4. Create a remote branch for gerrit<br>
> 5. Create a branch for your changes in the forked project<br>
> 6. Commit and push your changes to your branch<br>
> 7. When your branch is ready for review:<br>
> a. pull from origin<br>
> b. rebase your changes to the current state of the master<br>
> 8. git review<br>
><br>
> I've done steps 1-6 working but I can't easily test 7 & 8 without sending<br>
> in unnecessary changes for review. But if you lost your changes, you would<br>
> just clone your forked project again.<br>
<br>
</div>What I do is:<br>
<br>
  1) Clone from <a href="http://github.com/openstack/${project}" target="_blank">github.com/openstack/${project}</a><br>
<br>
  2) Click "fork" on $project on github<br>
<br>
  3) Add my fork as a remote to my local repo:<br>
<br>
       $> git remote add -f github git@github.com:markmc/${project}.git<br>
<br>
  4) Create my topic branch, hack commit my changes<br>
<br>
  5) Push to my forked repo:<br>
<br>
       $> git push github HEAD:${topic}<br>
<br>
  5) Hack, commit more changes, then clean up the series of patches<br>
     using 'rebase -i'<br>
<br>
       $> git rebase -i origin/master<br>
<br>
     this might involve rebasing onto latest upstream, squashing fixes<br>
     into an earlier patch, re-ordering changes, editing commit messages<br>
<br>
  6) Push to my forked repo either as a new branch if I worry that<br>
     others might have based their work on my first branch:<br>
<br>
       $> git push github HEAD:${topic}-v2<br>
<br>
     or, more usually, just push to the same branch:<br>
<br>
       $> git push github +HEAD:${topic}<br>
<br>
     (the '+' allows me to do a non-fast-forward push)<br>
<br>
  7) When I'm done, submit it with git-review<br>
<br>
<br>
I'm guessing the details of (5) and (6) is what you're missing?<br>
<br>
Cheers,<br>
Mark.<br>
<br>
</blockquote></div><br></div>