Changes between Version 7 and Version 8 of Chimera2/git


Ignore:
Timestamp:
May 6, 2013, 4:13:18 PM (13 years ago)
Author:
Conrad Huang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Chimera2/git

    v7 v8  
    66
    77The 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.
     8
     9== Initializing ''git'' Parameters ==
     10
     11Before using '''git''' repositories, it is a good idea to set the account and e-mail names that will be recorded.  For example, my '''git''' parameters are set with:
     12
     13{{{#!html
     14<pre style="margin-left:20px; margin-right:20px; border:solid 1px; padding:3px; background:white;">
     15$ git config --global user.name "Conrad Huang"
     16$ git config --global user.email conrad@cgl.ucsf.edu
     17}}}
    818
    919== Cloning a Developer Repository ==
     
    328338Obviously, 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.
    329339
    330 The main thing to remember is that any branch that is being used in this coordinated fashion should be set up properly using
    331  - '''git push''' ''remote_name branch_name''
    332 and
    333  - '''git branch --set-upstream''' ''branch_name remote_name/branch_name''
    334 where ''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.
     340In the example below, the '''myrepo''' repository on plato is cloned on host '''huck''' (a host at work).  A shared feature branch, '''multi_site''', is created as is a source file '''shared'''.  The feature branch is pushed to '''plato''' using '''git flow feature publish'''.  Afterwards, the '''plato''' repository is cloned on '''loft''' (a host at home).  The feature branch is initialized using '''git flow feature pull'''.  Once the feature branch exists on both hosts, the normal '''push''' and '''pull''' command from '''git''' may be used to synchronized the repositories.
     341
     342{{{#!html
     343<pre style="margin-left:20px; margin-right:20px; border:solid 1px; padding:3px; background:white;">
     344<b style="color:#22c;">conrad@huck ~$ git clone ssh://conrad@plato.cgl.ucsf.edu/usr/local/projects/chimera2/git/myrepo myrepo</b>
     345Cloning into 'myrepo'...
     346remote: Counting objects: 569, done.
     347remote: Compressing objects: 100% (542/542), done.
     348remote: Total 569 (delta 175), reused 276 (delta 16)
     349Receiving objects: 100% (569/569), 311.17 MiB | 20.57 MiB/s, done.
     350Resolving deltas: 100% (175/175), done.
     351<b style="color:#22c;">conrad@huck ~/myrepo$ git checkout master</b>
     352Branch master set up to track remote branch master from origin.
     353Switched to a new branch 'master'
     354<b style="color:#22c;">conrad@huck ~/myrepo$ git flow init -d</b>
     355Using default branch names.
     356
     357Which branch should be used for bringing forth production releases?
     358   - develop
     359   - master
     360Branch name for production releases: [master]
     361
     362Which branch should be used for integration of the "next release"?
     363   - develop
     364Branch name for "next release" development: [develop]
     365
     366How to name your supporting branch prefixes?
     367Feature branches? [feature/]
     368Release branches? [release/]
     369Hotfix branches? [hotfix/]
     370Support branches? [support/]
     371Version tag prefix? []
     372<b style="color:#22c;">conrad@huck ~/myrepo$ git flow feature start multi_site</b>
     373Switched to a new branch 'feature/multi_site'
     374
     375Summary of actions:
     376- A new branch 'feature/multi_site' was created, based on 'develop'
     377- You are now on branch 'feature/multi_site'
     378
     379Now, start committing on your feature. When done, use:
     380
     381     git flow feature finish multi_site
     382
     383<b style="color:#22c;">conrad@huck ~/myrepo$ echo "shared code" > shared</b>
     384<b style="color:#22c;">conrad@huck ~/myrepo$ git add shared</b>
     385<b style="color:#22c;">conrad@huck ~/myrepo$ git commit -m "shared code" shared</b>
     386[feature/multi_site da70383] shared code
     387 1 files changed, 1 insertions(+), 0 deletions(-)
     388 create mode 100644 shared
     389<b style="color:#22c;">conrad@huck ~/myrepo$ git flow feature publish multi_site</b>
     390Counting objects: 4, done.
     391Delta compression using up to 8 threads.
     392Compressing objects: 100% (2/2), done.
     393Writing objects: 100% (3/3), 283 bytes, done.
     394Total 3 (delta 1), reused 1 (delta 0)
     395To ssh://conrad@plato.cgl.ucsf.edu/usr/local/projects/chimera2/git/myrepo
     396 * [new branch]      feature/multi_site -> feature/multi_site
     397Already on 'feature/multi_site'
     398
     399Summary of actions:
     400- A new remote branch 'feature/multi_site' was created
     401- The local branch 'feature/multi_site' was configured to track the remote branch
     402- You are now on branch 'feature/multi_site'
     403
     404<i><b style="color:#2a2;">Subsequently, on another host...</b></i>
     405
     406<b style="color:#2a2;">[loft - ~]$ git clone ssh://conrad@plato.cgl.ucsf.edu/usr/local/projects/chimera2/git/myrepo myrepo</b>
     407Cloning into 'myrepo'...
     408remote: Counting objects: 569, done.
     409remote: Compressing objects: 100% (542/542), done.
     410Receiving objectsremote: Total 569 (delta 175), reused 276 (delta 16)
     411Receiving objects: 100% (569/569), 311.17 MiB | 586 KiB/s, done.
     412Resolving deltas: 100% (175/175), done.
     413<b style="color:#2a2;">[loft - ~]$ cd myrepo/</b>
     414/e/home/conrad/myrepo
     415<b style="color:#2a2;">[loft - ~/myrepo]$ git checkout master</b>
     416Branch master set up to track remote branch master from origin.
     417Switched to a new branch 'master'
     418<b style="color:#2a2;">[loft - ~/myrepo]$ git flow init -d</b>
     419Using default branch names.
     420
     421Which branch should be used for bringing forth production releases?
     422   - develop
     423   - master
     424Branch name for production releases: [master]
     425
     426Which branch should be used for integration of the "next release"?
     427   - develop
     428Branch name for "next release" development: [develop]
     429
     430How to name your supporting branch prefixes?
     431Feature branches? [feature/]
     432Release branches? [release/]
     433Hotfix branches? [hotfix/]
     434Support branches? [support/]
     435Version tag prefix? []
     436<b style="color:#2a2;">[loft - ~/myrepo]$ git flow feature pull origin multi_site</b>
     437Created local branch feature/multi_site based on origin's feature/multi_site.
     438<b style="color:#2a2;">[loft - ~/myrepo]$ cat shared</b>
     439shared code
     440<b style="color:#2a2;">[loft - ~/myrepo]$ echo "more shared code" >> shared</b>
     441<b style="color:#2a2;">[loft - ~/myrepo]$ git commit -a -m "more code added"</b>
     442<b style="color:#2a2;">[feature/multi_site f9d8a3d] more code added
     443 1 files changed, 1 insertions(+), 0 deletions(-)
     444[loft - ~/myrepo]$ git push</b>
     445Counting objects: 5, done.
     446Delta compression using up to 4 threads.
     447Compressing objects: 100% (2/2), done.
     448Writing objects: 100% (3/3), 279 bytes, done.
     449Total 3 (delta 1), reused 0 (delta 0)
     450To ssh://conrad@plato.cgl.ucsf.edu/usr/local/projects/chimera2/git/myrepo
     451   da70383..f9d8a3d  feature/multi_site -> feature/multi_site
     452
     453<i><b style="color:#22c;">Back to the first host...</b></i>
     454
     455<b style="color:#22c;">conrad@huck ~/myrepo$ git pull</b>
     456remote: Counting objects: 5, done.
     457remote: Compressing objects: 100% (2/2), done.
     458remote: Total 3 (delta 1), reused 0 (delta 0)
     459Unpacking objects: 100% (3/3), done.
     460From ssh://plato.cgl.ucsf.edu/usr/local/projects/chimera2/git/myrepo
     461   da70383..f9d8a3d  feature/multi_site -> origin/feature/multi_site
     462Updating da70383..f9d8a3d
     463Fast-forward
     464 shared |    1 +
     465 1 files changed, 1 insertions(+), 0 deletions(-)
     466
     467<b style="color:#22c;">conrad@huck ~/myrepo$ cat shared</b>
     468shared code
     469more shared code
     470
     471</pre>
     472}}}
    335473
    336474== Create Team Repository ==