[Users] Checking out branches with GetComponents
Erik Schnetter
schnetter at cct.lsu.edu
Tue Jun 15 09:56:19 CDT 2010
On Jun 15, 2010, at 9:51 , Barry Wardell wrote:
> 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
Are you sure that these commands work? I looked at <http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/
>, and it seemed more complex. In particular, it seems necessary to
create the remote branch before the local branch, because one cannot
push local branches to a remote repository.
Can you try this with a git repository of your own, and then update
the ET wiki pages accordingly? We should have the exact sequence of
commands there (as you are listing them here).
-erik
--
Erik Schnetter <schnetter at cct.lsu.edu> http://www.cct.lsu.edu/~eschnett/
More information about the Users
mailing list