Difference between revisions of "Git"

From UFRC
Jump to navigation Jump to search
Line 19: Line 19:
 
The admin user on a remote machine ''linux64'' can do the following
 
The admin user on a remote machine ''linux64'' can do the following
 
* Check out the admin repository
 
* Check out the admin repository
  git clone awesome@git.hpc.ufl.edu:gitosis-admin.git
+
  git clone awesome@git.hpc.ufl.edu:gitolite-admin.git
 
* Add more users e.g. 'student' with a  public key ''student.pub''
 
* Add more users e.g. 'student' with a  public key ''student.pub''
  cd gitosis-admin
+
  cd gitolite-admin
 
  cp ~/student.pub keydir/
 
  cp ~/student.pub keydir/
 
  git add keydir/*
 
  git add keydir/*
Line 27: Line 27:
 
  git push
 
  git push
 
* Create a new repository ''denovo'' for ''de novo'' assembly scripts and set access to users ''admin'' and ''student''
 
* Create a new repository ''denovo'' for ''de novo'' assembly scripts and set access to users ''admin'' and ''student''
  cd gitosis-admin
+
  cd gitolite-admin
  vim gitosis.conf
+
  vim conf/gitolite.conf
Add:
+
Add a group configuration:
[group awesome]
+
@mygroup = admin student
writable = denovo
+
Add a repository configuration
members = admin student
+
repo denovo
 +
    RW+    =   @mygroup
 +
    R      =   @all
 
* Commit and push
 
* Commit and push
 
  git add *
 
  git add *
Line 57: Line 59:
  
 
After a new user 'student is allowed access they can start using the repository.
 
After a new user 'student is allowed access they can start using the repository.
 +
 
===student@linux64===
 
===student@linux64===
 
* Clone the ''denovo'' repository
 
* Clone the ''denovo'' repository

Revision as of 19:58, 14 February 2013

Using git.hpc.ufl.edu

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 HPC Support] ticket system with a name like "Create an HPC Git repository for the "Awesome" group.
  • List your projected git usage:
  1. What group will be accessing it.
  2. Who would be the group administrator (username).
  3. How soon you need it set up.
  4. How much space you need i.e. what type of content is going to be stored in the repository.
  5. The uptime requirements i.e. whether the occasional downtime is acceptable.
  6. Where the repository administrator's public ssh key can be found (you can paste it into the support ticket).
  • 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:

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:gitolite-admin.git
  • Add more users e.g. 'student' with a public key student.pub
cd gitolite-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 gitolite-admin
vim conf/gitolite.conf

Add a group configuration: @mygroup = admin student Add a repository configuration repo denovo

   RW+     =   @mygroup
   R       =   @all
  • 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@git.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.

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

Git email reports

We can enable Git email reports for any repository. Please email the support or file a suport ticket. Once enabled, every "push" to the remote repository on git.hpc.ufl.edu will produce a commit email report to a defined list of email addresses.