[Users] Checking out branches with GetComponents

Barry Wardell barry.wardell at aei.mpg.de
Tue Jun 15 09:51:16 CDT 2010


Hi,

On 15/06/2010 16:09, Erik Schnetter wrote:
>> It seems that git clone has a "-b" option to specify which branch to
>> check out after the repository is cloned, but this doesn't seem to
>> exist in anything but the latest versions of git (for example, it
>> exists in 1.7.1 but not in 1.6.1).  So a separate "git checkout"
>> command will have to be run by GetComponents.
>>      
>
> We also need to collect on the wiki the commands that we need to
> execute to create these branches in the first place.  It's not trivial
> for git.
>
> Do you have experience with branches in git?  Is it easier to use
> branches, or to have separate repositories and push/pull changes in
> between?
>    
I think the best thing is to just have a single repository with a tag 
and branch for each release. This is quite straightforward to do:

1. Tag the current revision (if you want the revision signed, use 
something other than -a):

    git tag -a ET_2010_06
    git push --tags

2. Create a branch for the revision:

    git branch ET_2010_06
    git push origin refs/heads/ET_2010_06

If you then want to checkout the new branch, you use:

    git checkout -b ET_2010_06 origin/ET_2010_06

If you make a mistake and want to remove the remote branch, then you can 
do so with:

    git push origin :refs/heads/ET_2010_06

A good model for a large project working with git is the VLC project. 
They create a tag and branch for each release. In their case, they have 
the branches in separate repository, but only because there are so many 
extensive changes between versions and the single repository was getting 
quite large. I don't think in this case it is so important, but it can 
always be done at a later stage anyway. They also have a useful page 
listing all the useful commands they use for working with their 
repositories: http://wiki.videolan.org/Git

Regards,
Barry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20100615/ebd211a2/attachment.html 


More information about the Users mailing list