Changes between Version 2 and Version 3 of cypress/git
- Timestamp:
- 08/17/15 13:01:27 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
cypress/git
v2 v3 1 [[PageOutline]] 1 2 = Version Control with ''git'' = 2 3 3 4 Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. 4 5 5 To use git on Cypress, you have to load module. It is better to set this in ''.modulerc'' 6 To use git on Cypress, you have to load module. It is better to set this in ''.modulerc'' (see below). 6 7 {{{#!bash 7 [fuji@cypress2 workshop]$ module load git8 [fuji@cypress2 ~]$ module load git 8 9 }}} 9 10 … … 11 12 On your project directory, for example, (replace dpg with your project folder name) 12 13 {{{#!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 20 15 [fuji@cypress2 projectX]$ git init 21 Initialized empty Git repository in /lustre/project/dpg/ repos/git/projectX/.git/16 Initialized empty Git repository in /lustre/project/dpg/fuji/projectX/.git/ 22 17 }}} 23 18 … … 45 40 }}} 46 41 42 You can work with this repository on Cypress. 43 44 === Create a Bare Repository === 45 If 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 53 Add 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 57 Reinitialized existing shared Git repository in /lustre/project/dpg/repos/projectX.git/ 58 }}} 59 60 === Make a Clone Repository === 47 61 Make a clone repository on Cypress, 48 62 {{{#!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 50 64 Cloning into 'projectX'... 51 65 remote: Counting objects: 3, done. … … 59 73 Make a clone repository over network, (you may have to type password) 60 74 {{{#!bash 61 Hideki02:~ fuji$ git clone fuji@cypress1.tulane.edu:/lustre/project/dpg/repos/git/projectX 75 Hideki02:~ fuji$ git clone fuji@cypress1.tulane.edu:/lustre/project/dpg/repos/git/projectX.git 62 76 Cloning into 'projectX'... 63 77 remote: Counting objects: 3, done. … … 76 90 77 91 == Free Git Repository == 92 * [https://bitbucket.org/] 93 * [https://github.com/] 78 94 79 95 80 == add commit == 96 == Basic Commands == 97 98 === Add new files === 99 {{{#!bash 100 Hideki02:projectX fuji$ git add test.txt 101 }}} 102 This 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 106 Hideki02:projectX fuji$ git commit -m"message" 107 }}} 108 Stores 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 === 111 When 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 113 Hideki02:projectX fuji$ git push 114 }}} 115 You may have to type password for Cypress. 116 117 === pull === 118 To pull current project in the master repository, 119 {{{#!bash 120 Hideki02:projectX fuji$ git pull 121 }}} 122 123 == Documents == 124 * [https://git-scm.com/doc]