This is how I currently work with Git and the Bioconductor SVN. I'll use the affxparser package as an example.
% git clone [email protected]:HenrikBengtsson/affxparser.git
% cd affxparser
I'm using the Git Flow workflow everywhere, including this package. In short,
the master
branch reflects the most recent official release. In case of Bioconductor packages, this corresponds to the most
recent Bioc devel version. One philosophy behind Git Flow is that commits should never be done to the master
branch;
it should only receive merges from other branches. Any incremental development is typically done to the develop
branch
(note that this is not the same as the Bioc devel version; hence the renaming of devel
-> bioc-svn/devel
below).
Another concept of Git Flow is "feature" branches, which are branches one can uses for more long-term or larger additions
that are to complex/risky to do directly to the develop
branch. If successful, feature branches will later be merged into
develop
and then be closed/removed. If discontinued, they can be dropped without having to do any unrolling of commits.
% git checkout develop
% git checkout master
% git branch
develop
* master
From https://www.bioconductor.org/developers/how-to/git-mirrors/:
% curl -O https://raw.githubusercontent.com/Bioconductor/mirror/master/update_remotes.sh
% bash update_remotes.sh
Then I rename the locally created branches such that their names reflect they are
associated with the Bioconductor SVN branches (see also Bioconductor/mirror#10).
This also makes it less confusing when there is also the Git Flow develop
branch.
% git branch -m devel bioc/devel
% git branch -m release-3.0 bioc-svn/release-3.0
% git branch -m release-3.1 bioc-svn/release-3.1
% git branch -m release-3.2 bioc-svn/release-3.2
% git branch
bioc-svn/devel
bioc-svn/release-3.0
bioc-svn/release-3.1
bioc-svn/release-3.2
develop
* master
For now, I choose not to push these bioc-svn/*
branches to GitHub.
From https://www.bioconductor.org/developers/how-to/git-mirrors/:
% git checkout bioc-svn/devel
% git pull
% git svn rebase
Then merge this into the master
branch (such that the master
branch reflects the Bioc devel version):
% git checkout master
% git merge --ff-only bioc-svn/devel
If fast-forward merging is not possible, e.g.
% git merge --ff-only bioc-svn/devel
fatal: Not possible to fast-forward, aborting.
we need to cherry-pick the updates, e.g.
% git cherry-pick bioc-svn/devel
[master c371392] version bump
Author: khansen <khansen@bc3139a8-67e5-0310-9ffc-ced21a209358>
2 files changed, 4 insertions(+), 1 deletion(-)
When we know that the master
is in sync with bioc-svn/devel
:
% git diff master bioc-svn/devel
[ empty line]
we can push master
to GitHub:
% git push
Counting objects: 29, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 501 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
To [email protected]:HenrikBengtsson/affxparser.git
95395ed..c371392 master -> master
As typical last step in bringing in updates from the Bioconductor SVN server
is to merge the updates into the develop
branch;
% git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
% git merge master
Updating d1b0f06..c371392
Fast-forward
DESCRIPTION | 2 +-
NEWS | 3 +++
README.md | 11 -----------
appveyor.yml | 3 ++-
4 files changed, 6 insertions(+), 13 deletions(-)
If needed, I bump the version of the develop
branch to have a version x.y.z-9000
and commit and push:
% git commit DESCRIPTION -m "Bump develop version"
[develop 57991b5] Bump develop version
1 file changed, 1 insertion(+), 1 deletion(-)
% git push
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 296 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To [email protected]:HenrikBengtsson/affxparser.git
d1b0f06..57991b5 develop -> develop