Help:Git

From CECS wiki
Jump to navigation Jump to search

Git is a distributed revision control and source code management (SCM) system.

Vendor homepage
http://git-scm.com/
http://gitolite.com
Software availability
installed on most unix systems; ask if it is missing
available for windows, linux, mac, solaris
Other related software
subversion, mercurial, bitkeeper, cvs, rcs
command to type to run
git
View online documentation
git help
Available on OS X through Xcode
Available in windows through website above
man git
http://git-scm.com/doc
http://git-scm.com/documentation/external-links
http://gitref.org

Local gitolite repo[edit]

We have a local git repo (using gitolite) installed on a local server if you don't want to use github. This repo supports ssh only with no web access, and only on the UCF network (vpn included). (Read only web access could be added on request.)

Contact help@cs.ucf.edu with the following information:

  • The name of the repo(s) you would like to create
  • one or more ssh public keys, a login tag and permissions for each one (read, read/write)
  • name, email address, and permissions of any additional people you would like added (they can send us their ssh public key later and we'll match them up to your list)

Typically, you would want to create a ssh key on each machine you want a repo on for each user. This way, any single key can be revoked on request.

This repo has been tested against the standard git client on both windows, unix and mac. It works well, but you will need VPN access if off campus. The windows graphical git client is capable of generating its own ssh key.

By default the repo is created empty; The windows client will not clone an empty repo, but you can add the empty repo as a remote to your local repo. Once the repo contains something, others can then clone it in windows as normal.

Git repos not updated in 5 years may be archived and taken offline.

Wildcard repo patterns can also be requested.

To connect to to an existing repo or request new one[edit]

  1. download a client for your OS
  2. generate an SSH key (Git-GUI)
    1. (windows) double click on GIT GUI
    2. help -> Show SSH key
    3. if empty, Generate Key
    4. copy key to clipboard
  3. Alternative SSH Key Generation and linking (Git-Bash)
    1. Double Click Git Bash
    2. ssh-keygen -t rsa -b 4096
    3. Allow to save to default file location.
    4. PassPhrase can be empty.
    5. Link key to SSH.
      1. ssh-agent -s
      2. eval $(ssh-agent -s)
      3. ssh-add ~/.ssh/id_rsa (Or path you picked when generated key)
    6. ssh-keygen -y -f ~/.ssh/id_rsa (Or path you pick)
    7. Copy its output to clipboard. (This is ssh public key)
  4. send ssh public key to us along with reponame and your username for the repo (and tell us who else should have access)
  5. Clone existing repo (Reliable if repo is not empty)
    • source location will be git@newton.i2lab.ucf.edu:REPONAME
    • Target Directory is somewhere on your computer
    • choose full copy
  6. Empty Repo Setup (Bash)
    1. CD to directory for local new repo you will push to server.
    2. git init
    3. git push --set-upstream git@newton.i2lab.ucf.edu:(RepoName) master


Repeat the ssh generation step (if necessary) and submit it for each computer you want to have a copy of the repo on.

To generate a key in unix:

  1. look for ~/.ssh/id_rsa.pub to see if you already have one
  2. if not, type ssh-keygen -t rsa and follow the prompts
  3. send ~/.ssh/id_rsa.pub to us as above