2.4.12

Bioconductor, Git and SVN multiple branches

So the Bioconductor SVN repo is set up in the standard trunk / branches way, but as a developer, you only have write access to your package directory, which is either in "trunk/x/x/packageName" (dev) or "branches/releaseNum/x/x/packageName" (release). This is not what Git is expecting if you want to enable keeping track of release and dev in the same Git repository. How do you set it up so you can keep track of everything in a single repository like you might normally want?

I found some suggestions here, and show them below:

Clone your SVN repo:
git svn clone https://svnRepo/trunk/x/x/packageName packageName
Now add information about the branches:
git config --add svn-remote.releaseNum.url https://svnRepo/branches/releaseNum/x/x/packageName/
git config --add svn-remote.releaseNum.fetch :refs/remotes/releaseNum/
Now fetch and create a local branch tied to the remote:
git svn fetch releaseNum
git checkout -b local-releaseNum -t releaseNum
From these two branches, you should be able to create normal Git branches, work and modify them, and then go back and merge changes, rebase, and dcommit as usual. Although I'm sure you could clone each of these into separate git repos, you would then lose the ability to do a diff between them. I hope this saves someone else from searching over the web for a couple of hours.

Originally posted on my Wiki.

No comments:

Post a Comment