Explore Courses Blog Tutorials Interview Questions
+1 vote
in DevOps and Agile by (29.3k points)

I'm using git-svn to work against my company's central svn repository. We've recently created a new feature branch in the central repo. How do I tell git about it? When I run git branch -r I can only see the branches that existed when I ran fetch against the svn repo to initialize my git repo?

1 Answer

0 votes
by (50.2k points)

Instead of telling git-svn about a remote branch created, you can create a remote branch manually. For that you could use the following commands:

git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/

git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch

git svn fetch newbranch [-r<rev>]

git checkout -b local-newbranch -t newbranch

git svn rebase newbranch

The above commands will create a remote branch after you fetched the repo.

Browse Categories