Changes between Version 2 and Version 3 of Chimera2/git


Ignore:
Timestamp:
May 3, 2013, 11:28:53 AM (13 years ago)
Author:
Conrad Huang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Chimera2/git

    v2 v3  
    77The remainder of this document describes some common tasks using '''git'''.
    88
    9 == Create Developer Repository on plato ==
     9== Cloning a Developer Repository ==
     10
     11To 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.
     12
     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 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.
     14
     15After 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.
     16
     17{{{#!html
     18<pre style="margin-left:20px; margin-right:20px; border:solid 1px; padding:3px; background:white;">
     19<b style="color:#c22;">franklin:~ conrad$ cd /usr/local/projects/chimera2/git</b>
     20<b style="color:#c22;">franklin:git conrad$ git clone chimera2.git myrepo</b>
     21Initialized empty Git repository in /usr/local/projects/chimera2/git/myrepo/.git/
     22<b style="color:#c22;">franklin:git conrad$ cd myrepo</b>
     23/usr/local/projects/chimera2/git/myrepo
     24<b style="color:#c22;">franklin:myrepo conrad$ git flow init -d</b>
     25Using default branch names.
     26
     27Which branch should be used for bringing forth production releases?
     28   - master
     29Branch name for production releases: [master]
     30Branch name for "next release" development: [develop]
     31
     32How to name your supporting branch prefixes?
     33Feature branches? [feature/]
     34Release branches? [release/]
     35Hotfix branches? [hotfix/]
     36Support branches? [support/]
     37Version tag prefix? []
     38<b style="color:#c22;">franklin:myrepo conrad$ ls -l</b>
     39total 36
     40drwxrwxr-x  4 conrad ferrin 3864 May  3 11:01 docs/
     41-rw-rw-r--  1 conrad ferrin  183 May  3 11:01 index.html
     42-rw-rw-r--  1 conrad ferrin  657 May  3 11:01 Makefile
     43drwxrwxr-x  2 conrad ferrin 3864 May  3 11:01 mk/
     44drwxrwxr-x 28 conrad ferrin 3864 May  3 11:01 prereqs/
     45-rw-rw-r--  1 conrad ferrin 1262 May  3 11:01 README.rst
     46drwxrwxr-x  7 conrad ferrin 3864 May  3 11:01 src/
     47-rwxrwxr-x  1 conrad ferrin 3589 May  3 11:01 vsvars.sh*
     48drwxrwxr-x  3 conrad ferrin 3864 May  3 11:01 webdemo/
     49</pre>
     50}}}
     51
     52Alternatively, 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.
     53
     54{{{#!html
     55<pre style="margin-left:20px; margin-right:20px; border:solid 1px; padding:3px; background:white;">
     56<b style="color:#c22;">[loft - /e]$ git clone \
     57  ssh://conrad@plato.cgl.ucsf.edu/usr/local/projects/chimera2/git/chimera2.git \
     58  chimera2</b>
     59Cloning into 'chimera2'...
     60remote: Counting objects: 556, done.
     61remote: Compressing objects: 100% (533/533), done.
     62remote: Total 556 (delta 170), reused 275 (delta 16)
     63Receiving objects: 100% (556/556), 311.17 MiB | 621 KiB/s, done.
     64Resolving deltas: 100% (170/170), done.
     65<b style="color:#c22;">[loft - /e]$ cd chimera2</b>
     66/e/chimera2
     67<b style="color:#c22;">[loft - /e/chimera2]$ git flow init -d</b>
     68Using default branch names.
     69
     70Which branch should be used for bringing forth production releases?
     71   - master
     72Branch name for production releases: [master]
     73Branch name for "next release" development: [develop]
     74
     75How to name your supporting branch prefixes?
     76Feature branches? [feature/]
     77Release branches? [release/]
     78Hotfix branches? [hotfix/]
     79Support branches? [support/]
     80Version tag prefix? []
     81<b style="color:#c22;">[loft - /e/chimera2]$ ls -l</b>
     82total 26
     83-rw-r--r--+ 1 conrad None  657 May  3 10:51 Makefile
     84-rw-r--r--+ 1 conrad None 1262 May  3 10:51 README.rst
     85drwxr-xr-x+ 1 conrad None    0 May  3 10:51 docs/
     86-rw-r--r--+ 1 conrad None  183 May  3 10:51 index.html
     87drwxr-xr-x+ 1 conrad None    0 May  3 10:51 mk/
     88drwxr-xr-x+ 1 conrad None    0 May  3 10:51 prereqs/
     89drwxr-xr-x+ 1 conrad None    0 May  3 10:51 src/
     90-rwxr-xr-x+ 1 conrad None 3589 May  3 10:51 vsvars.sh*
     91drwxr-xr-x+ 1 conrad None    0 May  3 10:51 webdemo/
     92</pre>
     93}}}
    1094== Use ''develop'' Branch Directly for Development ==
    1195== Use Feature Branch for Development ==
    1296== Stash Modified Files before Switching Branches ==
    13 == Create Remote Repository ==
    1497== Use plato Repository to Coordinate Development on Multiple Hosts ==
    1598== Create Team Repository ==