Difference between revisions of "Git"

From UFRC
Jump to navigation Jump to search
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Infrastructure]][[Category:Docs]]
+
[[Category:Software]][[Category:Revision Control]]
==Installation==
+
{|<!--CONFIGURATION: REQUIRED-->
===Redhat EL 6.0===
+
|{{#vardefine:app|git}}
Simple installation:
+
|{{#vardefine:url|https://git-scm.com/}}
 +
<!--CONFIGURATION: OPTIONAL (|1}} means it's ON)-->
 +
|{{#vardefine:conf|}}          <!--CONFIGURATION-->
 +
|{{#vardefine:exe|1}}            <!--ADDITIONAL INFO-->
 +
|{{#vardefine:job|}}            <!--JOB SCRIPTS-->
 +
|{{#vardefine:policy|}}        <!--POLICY-->
 +
|{{#vardefine:testing|}}      <!--PROFILING-->
 +
|{{#vardefine:faq|}}            <!--FAQ-->
 +
|{{#vardefine:citation|}}      <!--CITATION-->
 +
|{{#vardefine:installation|}} <!--INSTALLATION-->
 +
|}
 +
<!--BODY-->
 +
<!--Description-->
 +
{{#if: {{#var: url}}|
 +
{{App_Description|app={{#var:app}}|url={{#var:url}}|name={{#var:app}}}}|}}
  
yum install git
+
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.
  
==Using git.hpc.ufl.edu==
+
Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.
===Request a group repository===
 
As an example we'll use the ''awesome'' group, administrative user (set up by HPC staff) ''admin'' and a regular user ''student''.
 
  
* Open a support ticket in the [http://support.hpc.ufl.edu HPC Support]] ticket system with a name like "Create an HPC Git repository for the "Awesome" group.
+
<!--Modules-->
* List your projected git usage:
+
==Environment Modules==
 +
Run <code>module spider {{#var:app}}</code> to find out what environment modules are available for this application.
 +
==System Variables==
 +
* HPC_{{uc:{{#var:app}}}}_DIR - installation directory
  
#What group will be accessing it.
+
<!--Configuration-->
#Who would be the group administrator (username).
+
{{#if: {{#var: conf}}|==Configuration==
#How soon you need it set up.
+
See the [[{{PAGENAME}}_Configuration]] page for {{#var: app}} configuration details.
#How much space you need i.e. what type of content is going to be stored in the repository.
+
|}}
#The uptime requirements i.e. whether the occasional downtime is acceptable.
+
<!--Run-->
#Where the repository administrator's public ssh key can be found (you can paste it into the support ticket).
+
{{#if: {{#var: exe}}|==Additional Information==
  
* Assuming that your usage pattern falls within the limits of our resources we'll create a repository 'awesome' on git.hpc.ufl.edu and configure it for the administrator. After that the administrator 'admin' can do the following:
+
UFRC git environment  module also contains a 'git-lfs' instance, so you can run 'git lfs ...' after loading the git environment module.
  
===admin@linux64===
+
|}}
The admin user on a remote machine ''linux64'' can do the following
+
<!--Job Scripts-->
* Check out the admin repository
+
{{#if: {{#var: job}}|==Job Script Examples==
git clone awesome@git.hpc.ufl.edu:gitosis-admin.git
+
See the [[{{PAGENAME}}_Job_Scripts]] page for {{#var: app}} Job script examples.
* Add more users e.g. 'student' with a  public key ''student.pub''
+
|}}
cd gitosis-admin
+
<!--Policy-->
cp ~/student.pub keydir/
+
{{#if: {{#var: policy}}|==Usage Policy==
git add keydir/*
 
git commit -m "added user student"
 
git push
 
* Create a new repository ''denovo'' for ''de novo'' assembly scripts and set access to users ''admin'' and ''student''
 
cd gitosis-admin
 
vim gitosis.conf
 
Add:
 
[group awesome]
 
writable = denovo
 
members = admin student
 
* Commit and push
 
git add *
 
git commit -m "Set up a new repository denovo for use by admin and student"
 
git push
 
* Create a local working tree for the ''denovo'' project:
 
cd
 
mkdir denovo
 
cd denovo
 
git init
 
git remote add origin awesome@hpc.ufl.edu:denovo.git
 
* Add and edit some files
 
* Commit and push to the Git server
 
git add *
 
git commit -m "Initial import"
 
git push origin master
 
Output:
 
Initialized empty Git repository in /git/awesome/repositories/denovo.git/
 
Counting objects: 3, done.
 
Writing objects: 100% (3/3), 231 bytes, done.
 
Total 3 (delta 0), reused 0 (delta 0)
 
To awesome@git.hpc.ufl.edu:denovo.git
 
* [new branch]      master -> master
 
  
After a new user 'student is allowed access they can start using the repository.
+
WRITE USAGE POLICY HERE (Licensing, usage, access).
===student@linux64===
+
 
* Clone the ''denovo'' repository
+
|}}
git clone awesome@git.hpc.ufl.edu:denovo.git
+
<!--Performance-->
Output:
+
{{#if: {{#var: testing}}|==Performance==
Cloning into denovo...
+
 
remote: Counting objects: 3, done.
+
WRITE_PERFORMANCE_TESTING_RESULTS_HERE
remote: Total 3 (delta 0), reused 0 (delta 0)
+
 
Receiving objects: 100% (3/3), done.
+
|}}
* Work in the git working tree
+
<!--Faq-->
cd denovo
+
{{#if: {{#var: faq}}|==FAQ==
Edit and add files
+
*'''Q:''' **'''A:'''|}}
* Commit and push the changes to the repository
+
<!--Citation-->
git add *
+
{{#if: {{#var: citation}}|==Citation==
git commit -m "The changes I made"
+
If you publish research that uses {{#var:app}} you have to cite it as follows:
git push
+
 
 +
WRITE_CITATION_HERE
 +
 
 +
|}}
 +
<!--Installation-->
 +
{{#if: {{#var: installation}}|==Installation==
 +
See the [[{{PAGENAME}}_Install]] page for {{#var: app}} installation notes.|}}
 +
<!--Turn the Table of Contents and Edit paragraph links ON/OFF-->
 +
__NOTOC____NOEDITSECTION__

Latest revision as of 17:09, 15 August 2022

Description

git website  

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.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Environment Modules

Run module spider git to find out what environment modules are available for this application.

System Variables

  • HPC_GIT_DIR - installation directory


Additional Information

UFRC git environment module also contains a 'git-lfs' instance, so you can run 'git lfs ...' after loading the git environment module.