How do I make git-svn use a particular svn branch as the remote repository?

A word of warning: I’m a n00b to git in general. My team uses feature branches in svn, and I’d like to use git-svn to track my work on a particular feature branch. I’ve been (roughly) following Andy Delcambre’s post to set up my local git repo, but those instructions seem to have led git to pick the svn branch that had changed most recently as the remote repository; the problem is that’s not the branch I care about. How do I control which branch git-svn uses? Or am I approaching this completely wrong?

UPDATE: I did use the -T, -b, and -t options (in my case because the svn repo has multiple projects, but I want the git repo to contain only the project I’m working on).

  • Use forever-branches or directories for project related documentation, wireframes, designs, etc.?
  • Git: How to merge a small, but very old branch?
  • How do I delete a local git branch when it can't look up commit object in 'refs/heads'?
  • Clearing special permissions from folders in a branch
  • Why are Mercurial backouts in one branch affecting other branches?
  • Safely delete a TFS branch project
  • How to set up a mirror repo on GitHub
  • GAE: Trouble with push to deploy
  • Github: Push additional commit to pull request
  • Is it possible to do a shallow git clone based on datetime?
  • Telling git not to change a file
  • GIT repositories with some different files
  • 4 Solutions collect form web for “How do I make git-svn use a particular svn branch as the remote repository?”

    Muchas gracias to Bart’s Blog for this handy reference for svn branches in git. Apparently all I needed was to specify a remote branch when creating the git branch, e.g.,

    git checkout -b git-topic-branch-foo foo

    where foo is the name of the remote branch.

    You might also have a look at this: git-svn is a gateway drug – robby on rails.

    I used something like this when I needed to make sure that my local branch was pointing to the correct remote svn branch:

    git branch -r

    to get the name of the remote branch I want to be tracking. Then

    git reset --hard remotes/svn-branch-name

    to explicitly change my local branch to point to a different remote branch.

    I needed to run ‘git svn fetch’ first, since the branch I wanted to associate with had been created after my git client.

    I use git-svn but I haven’t used the features that interoperate with SVN branches. Having said that, I notice that the tutorial you were following didn’t use the -T, -b, -t options to git svn init. These options tell git-svn what the upstream trunk/branches/tags directories are named, which might be important in your situation.

    Git Baby is a git and github fan, let's start git clone.