Git Repositories (SSH)

Introduction

Git is a distributed version control system, originally developed by Linus Torvalds for Linux kernel development. It has grown over the years to serve as the development platform for many other very large and active open source projects. It has grown for a very simple reason: it is excellent.

Once you have the Git client installed on your development machine, accessing your repository is simple.

NOTE: Unlike Subversion, it is not possible to clone a brand new repository when using SSH. You must first push data to it and only then it can be cloned by others. So if you are starting with a new Git repository, please first read the Importing section.

NOTE: It is possible to access your Git repositories via HTTPS instead of SSH. This does not require the use of SSH keys and is much simpler. If you wish to access your Git repository via HTTPS, please see our Git over SSL instructions.

Authentication

Unfuddle will authenticate all access over SSH to your repositories using public key cryptography. As such, you must first create an SSH key-pair locally on your machine and paste the contents of your public key into your "Personal Settings". For more information on how to generate a public key, please see Generating Git SSH Key-pairs.

Identification

If this is your first time using Git you will want to enter your name and email information as they are in your Unfuddle account into your Git config. This information is referenced in Unfuddle to show the Author of commits as well as tracking time on your tickets via Powerful Commit Messages. You can do this with the following commands:

$ git config --global user.name "Your Name"
$ git config --global user.email "email_address@example.com"

NOTE: If you already have this set globally in your config but would like to update your Unfuddle repository with this information you can remove the --gloabl option and run these commands after you clone or import from within the local repository. This will overwrite any global configs set in your git config for the specific repository only.

Importing

Local Repository Creation

If you are loading up your Git repository for the first time you will first need to create a local Git repository on your machine by doing the following:

$ mkdir /path/to/repository
$ cd /path/to/repository
$ git init

Once you have created a Git repository it's time associate the Unfuddle repository with your local one and designate it as an upstream server.

$ cd /path/to/repository
$ git remote add unfuddle git@subdomain.unfuddle.com:subdomain/abbreviation.git
$ git config remote.unfuddle.push refs/heads/master:refs/heads/master

NOTE: subdomain and abbreviation must be replaced with values appropriate to your account and repository.

Before you can push your code to the Unfuddle repository you must be sure to add your files to the local index then commit them.

$ git add *
$ git commit -am 'initial commit'

Finally, you are now ready to push any locally made commits to your newly created Unfuddle Git repository.

$ git push unfuddle master

Congratulations! You should now see all of your commits and files within your Unfuddle repository up online. Other members of your project may now clone the repository.

NOTE: Unlike Subversion, it is not possible to clone a brand new repository. You must first push data to it and only then it can be cloned by others.

Cloning

If your Git repository has already been populated with some commits, then it is now possible to clone that repository onto any number of machines.

$ git clone git@subdomain.unfuddle.com:subdomain/abbreviation.git

NOTE: subdomain and abbreviation must be replaced with values appropriate to your account and repository.

Additional Resources

For more information on how to get the most out of Git we recommend some of the following resources: