[gmx-developers] git with release branch

Mark Abraham Mark.Abraham at anu.edu.au
Tue Sep 15 15:24:48 CEST 2009


David van der Spoel wrote:
> Hi guys,
> 
> I would like some confirmation to see whether I'm doing the right thing 
> with git here:
> 
> git branch remotes/origin/release-4-0-patches
> git pull
> < edit files >
> git commit gmx_clustsize.c
> git push
> 
> Now I presume this is should be going into the release branch?

Looks about right. The following would also work:

git clone git at git.gromacs.org:gromacs
git checkout release-4-0-patches
< edit files >
git commit gmx_clustsize.c
git push

so depending how you cloned, you might just have been able to checkout 
straight away.

> How do I now get it into the main branch as well?

I understand the intended approach is to "cherry pick" a set of commits 
and apply them to another branch. So if the hash of the above commit was 
abe334 then

git checkout master
git cherry-pick abe334

will transfer the equivalent of that commit to master branch, and commit 
it again there with the same commit message. Various options can modify 
this behaviour. Presumably merge conflicts can arise and need to be 
dealt with in the usual way. Using a uniquely identifiable first few 
characters of a hash suffices.

See http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html

Mark



More information about the gromacs.org_gmx-developers mailing list