Difference between revisions of "Git"

From UFRC
Jump to navigation Jump to search
Line 1: Line 1:
 +
[[Category:Infrastructure]][[Category:Docs]]
 
==Installation==
 
==Installation==
 
===Redhat EL 6.0===
 
===Redhat EL 6.0===
Line 4: Line 5:
  
 
  yum install git
 
  yum install git
 +
 +
==Using git.hpc.ufl.edu==
 +
As an example we'll use the ''awesome'' group, administrative user (set up by HPC staff) ''admin'' and a regular user ''student''.
 +
===admin@linux64===
 +
The admin user on a remote machine ''linux64'' can do the following
 +
* Check out the admin repository
 +
git clone awesome@git.hpc.ufl.edu:gitosis-admin.git
 +
* Add more users e.g. 'student' with a  public key ''student.pub''
 +
cd gitosis-admin
 +
cp ~/student.pub keydir/
 +
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
 +
 +
===student@linux64===
 +
* Clone the ''denovo'' repository
 +
git clone awesome@git.hpc.ufl.edu:denovo.git
 +
Output:
 +
Cloning into denovo...
 +
remote: Counting objects: 3, done.
 +
remote: Total 3 (delta 0), reused 0 (delta 0)
 +
Receiving objects: 100% (3/3), done.
 +
* Work in the git working tree
 +
cd denovo
 +
Edit and add files
 +
* Commit and push the changes to the repository
 +
git add *
 +
git commit -m "The changes I made"
 +
git push

Revision as of 19:16, 11 October 2011

Installation

Redhat EL 6.0

Simple installation:

yum install git

Using git.hpc.ufl.edu

As an example we'll use the awesome group, administrative user (set up by HPC staff) admin and a regular user student.

admin@linux64

The admin user on a remote machine linux64 can do the following

  • Check out the admin repository
git clone awesome@git.hpc.ufl.edu:gitosis-admin.git
  • Add more users e.g. 'student' with a public key student.pub
cd gitosis-admin
cp ~/student.pub keydir/
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

student@linux64

  • Clone the denovo repository
git clone awesome@git.hpc.ufl.edu:denovo.git

Output:

Cloning into denovo...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
  • Work in the git working tree
cd denovo

Edit and add files

  • Commit and push the changes to the repository
git add *
git commit -m "The changes I made"
git push