| 9 | | == Create Developer Repository on plato == |
| | 9 | == Cloning a Developer Repository == |
| | 10 | |
| | 11 | To 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 | |
| | 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. |
| | 14 | |
| | 15 | After 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> |
| | 21 | Initialized 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> |
| | 25 | Using default branch names. |
| | 26 | |
| | 27 | Which branch should be used for bringing forth production releases? |
| | 28 | - master |
| | 29 | Branch name for production releases: [master] |
| | 30 | Branch name for "next release" development: [develop] |
| | 31 | |
| | 32 | How to name your supporting branch prefixes? |
| | 33 | Feature branches? [feature/] |
| | 34 | Release branches? [release/] |
| | 35 | Hotfix branches? [hotfix/] |
| | 36 | Support branches? [support/] |
| | 37 | Version tag prefix? [] |
| | 38 | <b style="color:#c22;">franklin:myrepo conrad$ ls -l</b> |
| | 39 | total 36 |
| | 40 | drwxrwxr-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 |
| | 43 | drwxrwxr-x 2 conrad ferrin 3864 May 3 11:01 mk/ |
| | 44 | drwxrwxr-x 28 conrad ferrin 3864 May 3 11:01 prereqs/ |
| | 45 | -rw-rw-r-- 1 conrad ferrin 1262 May 3 11:01 README.rst |
| | 46 | drwxrwxr-x 7 conrad ferrin 3864 May 3 11:01 src/ |
| | 47 | -rwxrwxr-x 1 conrad ferrin 3589 May 3 11:01 vsvars.sh* |
| | 48 | drwxrwxr-x 3 conrad ferrin 3864 May 3 11:01 webdemo/ |
| | 49 | </pre> |
| | 50 | }}} |
| | 51 | |
| | 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. |
| | 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> |
| | 59 | Cloning into 'chimera2'... |
| | 60 | remote: Counting objects: 556, done. |
| | 61 | remote: Compressing objects: 100% (533/533), done. |
| | 62 | remote: Total 556 (delta 170), reused 275 (delta 16) |
| | 63 | Receiving objects: 100% (556/556), 311.17 MiB | 621 KiB/s, done. |
| | 64 | Resolving 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> |
| | 68 | Using default branch names. |
| | 69 | |
| | 70 | Which branch should be used for bringing forth production releases? |
| | 71 | - master |
| | 72 | Branch name for production releases: [master] |
| | 73 | Branch name for "next release" development: [develop] |
| | 74 | |
| | 75 | How to name your supporting branch prefixes? |
| | 76 | Feature branches? [feature/] |
| | 77 | Release branches? [release/] |
| | 78 | Hotfix branches? [hotfix/] |
| | 79 | Support branches? [support/] |
| | 80 | Version tag prefix? [] |
| | 81 | <b style="color:#c22;">[loft - /e/chimera2]$ ls -l</b> |
| | 82 | total 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 |
| | 85 | drwxr-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 |
| | 87 | drwxr-xr-x+ 1 conrad None 0 May 3 10:51 mk/ |
| | 88 | drwxr-xr-x+ 1 conrad None 0 May 3 10:51 prereqs/ |
| | 89 | drwxr-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* |
| | 91 | drwxr-xr-x+ 1 conrad None 0 May 3 10:51 webdemo/ |
| | 92 | </pre> |
| | 93 | }}} |