me and my git-svn
Thu, Apr 3, 2008 dev opsI recently switched a bunch of my projects over to git. Why? All the cool kids are doing it, I figured I'd give it a shot. Either way I ran into a few bumps with the git-svn stuff. Everything went really well until I tried to push back my changes from git. I'd been committing changes to my repo and pushing them to github/hasno without issue. I ran into errors when I tried to git-svn dcommit
.
Here's what I'm currently calling the right way, as usual ymmv:
-
init if you haven't done i already, check .git/config for an svn-remote entry...
git-svn init <repo url>
-
pull the svn revision information. a bunch of info should scroll by matching svn revisions to git sha1 revisions.
git-svn fetch
-
this will yeild a list of local & remote branches, you should see trunk in the list
git branch -a
* master origin/HEAD origin/local-svn origin/master tags/release-0.1.23 tags/release-0.2.42 tags/release-0.2.44 tags/release-0.2.50 trunk
-
switch to a local branch based on the trunk remote branch
afaik you really don't want to be doing any of this type of stuff in a remote branchgit checkout -b local-svn trunk
-
now we need to pull your local changes from your master branch to your local-svn branch
git merge master
it's worth noting that you could do agit rebase
, but when I tried that I couldn't use git-svn dcommit -
go through and merge any conflicts. then
git commit
. at this point you cangit dcommit
So if all that was how I got it working, what did I run into along the way... Well I'm glad you ask. Here's a list of errors and the reason for them afaik:
- Unable to determine upstream SVN information from HEAD history
- You have a recent commit that doesn't have any history in .git/ref/remote/svn or .git/svn. It also doesn't have the git-svn-id: key in the commit message.
- [svn-remote "svn"] unknown
- Did you manually create the svn-remote entry, or specify a different name? If so you need to pass that on to the commands, they seem to assume it's named svn.
- fatal: bad default revision 'refs/remotes/git-svn'
- Somethings amiss with your svn-remote entry in
.git/config
That's about it for me, if you've seen those errors and can add some detail or shed some light on a better way please do share. As of this moment ruby-hl7 is synched up.