I've been using Git with SVN repositories for a while now. And for the most part it's good, really good.
If you want an introduction on where to start I suggest you read Emmanuel Bernard's entry on this exact topic. It's simple, to the point and will get you started in no time.
Today though I got bitten by some rather strange 'bug' of Git SVN. My master
branch wasn't linked to remotes/trunk
as I always expect. Apparently the branch that was last commited to (in SVN) is the one that gets linked to master
.
Thankfully there is nothing that a quick Google search can't fix. And I found that one just has to issue the following command to fix that:
git reset --hard remotes/trunk
Thanks to Horst Gutmann for posting this before me.
Update:
A simple way to know what master
is linked to is to issue the following command right after you cloned your SVN repository:
git svn dcommit
It will actually tell you where it is going to commit anything that should be.
And if you use "git svn dcommit -n" it doesn't even attempt to commit anything (-n or --dry-run).
ReplyDelete"git svn info" will tell you exactly where you'll be committing to in SVN.
ReplyDelete@Stefan Thanks, didn't think about the dry run. Git still won't run the command if you have a dirty index though, so you might have to use git stash
ReplyDelete@James true. And no need to stash or anything. Thanks for the tip.