Given the problems I'm having, I decided to set up a new local Git repository for futher work. Here's how to do it:
$ git clone git://git.apache.org/tapestry5.git
This sets up a new working folder, tapestry5
. It takes it a while to download the necessary Git repository objects.
$ cd tapestry5 $ curl http://git.apache.org/authors.txt -o .git/authors.txt $ git config svn.authorsfile .git/authors.txt
This fetches the current list of authors so that proper names appear in various Git reports, then configures Git to make use of the file.
$ git svn init --prefix=origin/ --trunk=trunk https://svn.apache.org/repos/asf/tapestry/tapestry5
This tells Git where to sync from and to.
$ git svn rebase
And that finishes things up, ensuring that you have all the most recent revisions.
From here on in, the two commands you need the most are git svn rebase
(to pull in repository changes) and git svn dcommit
(to push deltas back to Subversion). You should always rebase
before a dcommit
.
Perhaps that's not quite complete; I generally create local Git topic branches; so I start my work with git co -Blocal
to create (or overwrite) my local branch, do my work there as a series of commits, then: git co trunk ; git rebase local
to move those commits back over to trunk before git svn dcommit
. This helps a lot if you ever have to deal with a merge.
When I'm fixing particular bugs, I often create a branch names after the bug id.
Update: Removed the --tags and --branches arguments ... mostly because of how horribly Git SVN works with branches (don't try it!), and to make the init step nice and fast.
1 comment:
If you do not have git-svn on Mac OS X, please follow these instructions
http://blog.emmanuelbernard.com/2009/01/how-to-install-git-and-git-svn-on-mac.html article
Post a Comment