From: Mike Mazur <mmazur@gmail.com>
To: git@vger.kernel.org
Subject: Workflow for sharing changes on top of often-rebased work
Date: Thu, 6 Nov 2008 10:57:58 +0900 [thread overview]
Message-ID: <20081106105758.7107a801@sumo> (raw)
Hi,
I have a set of changes on top of an SVN tree I'm tracking with git.
The SVN changes regularly, and I like to keep my changes up-to-date as
well. The branch containing my changes lives on my workstation, but
also in a remote repo so I can also work from my laptop, and others can
look at my work.
Here's my current workflow:
First, I clone the SVN repo on my workstation:
$ git svn clone ssh://remote/svn repo
$ cd repo
I then created a bare repo on a server (git://remote/repo) which is how
I share my changes between my workstation, laptop, and others. In my
repo, I add this remote location as origin. Occasionally I will rebase
my master against SVN and push this to the server:
$ git remote add origin git://remote/repo
$ git remote update
$ git checkout master
$ git svn rebase
$ git push origin master:master
Now, to do my work, I made a branch based on master in which my changes
will live:
$ git branch my_work master
$ git checkout my_work
Then I hack away and have a bunch of commits. I publish this branch on
my server:
$ git checkout my_work
$ git push origin my_work # create branch my_work in git://remote/repo
Eventually, I'd like to rebase this work on top of the latest SVN
revision. First I update my master branch against SVN:
$ git checkout master
$ git svn rebase
$ git push origin master:master
And then I rebase my work on top of that:
$ git checkout my_work
$ git rebase master
# resolve conflicts
$ git rebase --continue
At this point, I'd like to push my_work to the server:
$ git checkout my_work
$ git push origin my_work:my_work
To git://remote/repo
! [rejected] my_work -> my_work (non-fast forward)
error: failed to push some refs to 'git://remote/repo'
What's the proper way to do this?
I've read a few threads in the archives and came across an email by
Junio[1] that shows how using `git push --force` and setting
"receive.denynonfastforwards = false" on the remote repo will allow me
to push these changes. Is this the best way forward? If it is, how do I
(or others) update the my_work branch after a non-fast forward push to
the remote repo?
Your insights greatly appreciated!
Mike
[1] http://marc.info/?l=git&m=119540948816950&w=2
reply other threads:[~2008-11-06 1:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081106105758.7107a801@sumo \
--to=mmazur@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox