Changes between Version 2 and Version 3 of cypress/git


Ignore:
Timestamp:
Aug 17, 2015 1:01:27 PM (6 years ago)
Author:
fuji
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/git

    v2 v3  
     1[[PageOutline]]
    12= Version Control with ''git'' =
    23
    34Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
    45
    5 To use git on Cypress, you have to load module. It is better to set this in ''.modulerc''
     6To use git on Cypress, you have to load module. It is better to set this in ''.modulerc'' (see below).
    67{{{#!bash
    7 [fuji@cypress2 workshop]$ module load git
     8[fuji@cypress2 ~]$ module load git
    89}}}
    910
     
    1112On your project directory, for example, (replace dpg with your project folder name)
    1213{{{#!bash
    13 [fuji@cypress2 ~]$ cd /lustre/project/dpg
    14 [fuji@cypress2 dpg]$ mkdir repos
    15 [fuji@cypress2 dpg]$ cd repos
    16 [fuji@cypress2 repos]$ mkdir git
    17 [fuji@cypress2 repos]$ cd git
    18 [fuji@cypress2 git]$ mkdir projectX
    19 [fuji@cypress2 git]$ cd projectX
     14[fuji@cypress2 fuji]$ cd projectX
    2015[fuji@cypress2 projectX]$ git init
    21 Initialized empty Git repository in /lustre/project/dpg/repos/git/projectX/.git/
     16Initialized empty Git repository in /lustre/project/dpg/fuji/projectX/.git/
    2217}}}
    2318
     
    4540}}}
    4641
     42You can work with this repository on Cypress.
     43
     44=== Create a Bare Repository ===
     45If you want to make a git server repository, you have to make a Bare Repository. For example,
     46
     47{{{#!bash
     48[fuji@cypress2 dpg]$ mkdir repos
     49[fuji@cypress2 dpg]$ cd repos
     50[fuji@cypress2 repos]$ git clone --bare ../fuji/projectX ./projectX.git
     51}}}
     52
     53Add group write permissions to a repository so that people in your group can pull/push.
     54 {{{#!bash
     55[fuji@cypress2 repos]$ cd projectX.git
     56[fuji@cypress2 projectX.git]$ git init --bare --shared
     57Reinitialized existing shared Git repository in /lustre/project/dpg/repos/projectX.git/
     58}}}
     59
     60=== Make a Clone Repository ===
    4761Make a clone repository on Cypress,
    4862{{{#!bash
    49 [fuji@cypress2 ~]$ git clone file:///lustre/project/dpg/repos/git/projectX
     63[fuji@cypress2 ~]$ git clone file:///lustre/project/dpg/repos/git/projectX.git
    5064Cloning into 'projectX'...
    5165remote: Counting objects: 3, done.
     
    5973Make a clone repository over network, (you may have to type password)
    6074{{{#!bash
    61 Hideki02:~ fuji$ git clone fuji@cypress1.tulane.edu:/lustre/project/dpg/repos/git/projectX
     75Hideki02:~ fuji$ git clone fuji@cypress1.tulane.edu:/lustre/project/dpg/repos/git/projectX.git
    6276Cloning into 'projectX'...
    6377remote: Counting objects: 3, done.
     
    7690
    7791== Free Git Repository ==
     92* [https://bitbucket.org/]
     93* [https://github.com/]
    7894
    7995
    80 == add commit ==
     96== Basic Commands ==
     97
     98=== Add new files ===
     99{{{#!bash
     100Hideki02:projectX fuji$ git add test.txt
     101}}}
     102This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.
     103
     104=== Commit ===
     105{{{#!bash
     106Hideki02:projectX fuji$ git commit -m"message"
     107}}}
     108Stores the current contents of the index in a new commit along with a log message from the user describing the changes. At this point, only your local clone has your modification.
     109
     110=== push ===
     111When you have your project at a point that you want to share with your group people, you have to push it to a master repository.
     112{{{#!bash
     113Hideki02:projectX fuji$ git push
     114}}}
     115You may have to type password for Cypress.
     116
     117=== pull ===
     118To pull current project in the master repository,
     119{{{#!bash
     120Hideki02:projectX fuji$ git pull
     121}}}
     122
     123== Documents ==
     124* [https://git-scm.com/doc]