Changes between Version 3 and Version 4 of Chimera2/git


Ignore:
Timestamp:
May 3, 2013, 12:15:14 PM (13 years ago)
Author:
Conrad Huang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Chimera2/git

    v3 v4  
     1= Chimera 2 Revision Control =
     2
    13[[PageOutline]]
    24
    3 = Chimera 2 Revision Control =
    4 
    55We will use '''git''' and '''git flow''' for revision control to manage Chimera 2 source code.  Development will follow the [http://nvie.com/posts/a-successful-git-branching-model/ Vincent Driessen's branching model] where the '''master''' branch is the release branch and the '''develop''' branch is the daily build branch.  A ''team repository'' is the repository that is used to create release and daily builds, ''i.e.'', changes committed in developer repositories but not pushed to the team repository will not appear in either release or daily builds.
    66
    7 The remainder of this document describes some common tasks using '''git'''.
     7The remainder of this document describes some common tasks using '''git'''.  ''plato'' refers to the Linux cluster on which the team repository is stored.  ''franklin'' is the name of a node in the plato cluster.
    88
    99== Cloning a Developer Repository ==
     
    1111To make changes to the source code, a developer must have a working repository.  The repository may be on the same host as the team repository, or it may be on a separate host.
    1212
    13 The following example shows the steps for creating a repository in the same directory, ''/usr/local/projects/chimera/git'', as the team repository.  Developer repositories do not need to be the the same directory as the team repository.  The last argument to '''git clone''' specifies the location where the developer repository will be created and it may be a full path.  However, the web server on the cluster is configured to simplify accessing files below ''/usr/local/projects/chimera/git'' (see NotYetWritten), for example, for viewing changes to HTML files; so it may be more convenient to have developer repositories there than elsewhere.
     13The following example shows the steps for creating a repository in the same directory, ''/usr/local/projects/chimera/git'', as the team repository.  Developer repositories do not need to be the the same directory as the team repository.  The last argument to '''git clone''' specifies the location where the developer repository will be created and it may be a full path.  However, the web server on plato is configured to simplify accessing files below ''/usr/local/projects/chimera/git'' (see NotYetWritten), for example, for viewing changes to HTML files; so it may be more convenient to have developer repositories there than elsewhere.
    1414
    1515After cloning the repository, it is necessary to initialize it for '''git flow''', the tool for managing branches.  The '''-d''' flag specifies that the default branch names for development and feature branches be used.  Even if there is no plan to use '''git flow''' operations, executing this command is useful since it checks out the '''develop''' branch rather than leaving the repository on the '''master''' branch, which should only be modified during releases.
     
    5050}}}
    5151
    52 Alternatively, a developer may use a repository on his own workstation rather than the cluster.  Below is an example of creating a clone on the remote host, <b>loft</b>, running Cygwin on Windows 7.  The <b>ssh</b> agent has already been initialized, so no passwords are required.  The steps after '''git clone''' are effective the same as the example above.
     52Alternatively, a developer may use a repository on his own workstation rather than plato.  Below is an example of creating a clone on the remote host, <b>loft</b>, running Cygwin on Windows 7.  The <b>ssh</b> agent has already been initialized, so no passwords are required.  The steps after '''git clone''' are effective the same as the example above.
    5353
    5454{{{#!html
     
    9696== Stash Modified Files before Switching Branches ==
    9797== Use plato Repository to Coordinate Development on Multiple Hosts ==
     98
     99Sometimes, a developer may use several hosts for development, ''e.g.'', a home machine, an office desktop and a laptop.  '''git''' may be used to coordinate the changes made on different hosts.  Rather than cloning directly from the team repository, the developer can create a plato clone first, ''e.g.'', ''myrepo''; then local repositories on each host may be cloned from ''myrepo''.  Changes may then be pushed and pulled from the remote host to ''myrepo'' without making any changes to the team repository.  For example, one can
     100 - make and commit a change at the office,
     101 - push the change to ''myrepo'' for pick up from home,
     102 - go home and pull the change from ''myrepo'',
     103 - continue development at home,
     104 - commit changes and push to ''myrepo'' so that they can be pulled from the office.
     105
     106Obviously, the coordinating repository does not need to reside on plato.  However, it should be on a host that remains accessible from the network at all times so that changes may be pushed or pulled.
     107
     108The main thing to remember is that any branch that is being used in this coordinated fashion should be set up properly using
     109 - '''git push''' ''remote_name branch_name''
     110and
     111 - '''git branch --set-upstream''' ''branch_name remote_name/branch_name''
     112where ''remote_name'' is the '''git''' name for the coordinating repository.  If the remote repositories are cloned from the coordinating repository, then the standard name ''origin'' may be used.
     113
    98114== Create Team Repository ==
    99115