Eddified
Eddified

Reputation: 3154

git svn workflow: how to use svn remote branches?

I have cloned my svn repo using git, specifying branches and trunk (no tags involved). Then, I ran fetch for a limited range of revisions. Now, I have:

$ git branch
* master

and

$ git branch -r
  version-2.3.1
  version-2.3.2
  version-2.3.3
  trunk

So, I understand that these branches are remote branches, and I did read http://git-scm.com/book/en/Git-Branching-Remote-Branches , but because remote branches are new to me, I'm having a hard time understanding how to use that knowledge in a svn context. One person at this link How to switch svn branches using git-svn? said to just do:

git reset --hard remotes/branch
git checkout branch
etc

but the 2nd command, "git checkout branch" doesn't apply to me since I don't have any local branches.....

So, now that I've got a bunch of remote branches that correspond to svn branches, what is the recommended workflow for "svn switch"ing to one of the branches, dcommit'ing, then "svn switch"ing back to a different branch? I never use trunk, I'm always working on branches.

Upvotes: 3

Views: 319

Answers (1)

lijinma
lijinma

Reputation: 2942

Now you are in master branch, you just:

git reset --hard version-2.3.3

and then your master branch is same as remote branch version-2.3.3.

Create another branch:

git checkout -b local-version-2.3.1
git reset --hard version-2.3.1

Then you create a new branch named: local-version-2.3.1, and it's the same as remote branch version-2.3.1.

Good luck.

Upvotes: 2

Related Questions