These instructions will get you up and running with Git. You should only need to run them once per computer you use.
Configure your identity
Start by opening Terminal/Cygwin and running the following commands, replacing the information with your own. This will tell Git who you are and allow us to determine who made what changes.
git config --global user.name "Jane Smith"
git config --global user.email "firstname.lastname@example.org"
Create a public key
Still in Terminal/Cygwin, run the following commands to create a public key pair to use to communicate securely with our servers. Replace the email address with your own
ssh-keygen -t rsa -C "email@example.com"
# When prompted for a file name, enter "uottawa_gitlab".
cp ~/.ssh/gitlab.pub ~/gitlab.pub
Configure your GitLab account
Next, you will need to create and configure your GitLab account. GitLab is the software that allows us to share Git repositories with each other.
- Login to uOttawa's GitLab server using your Exchange username and password (the same credentials you use for your email).
- Click on the small person icon that says "Profile settings" when you hover over it, in the top right-hand corner.
- Click on the link in the left-hand navigation that says "SSH Keys".
- Click on the green button that says "+ Add SSH Key" in the top right-hand corner.
- For the Title, you can enter whatever you want - we suggest something like "Jane's Workstation".
- For the Key, open the file in your home directory named gitlab.pub (if you are on Windows, this will be in your cygwin home directory, usually located under C:\cygwin\home\) and copy the contents of the file into the text area control.
- Click "Add Key".
Request project access
Email Bryan Miller, requesting access to the uoWeb project.
Configure your system
Back in terminal, run the following commands to configure an SSH host entry for GitLab.
# enter the following text, then save and exit.
ssh -T gitlab
# Enter "yes" whne prompted with the RSA fingerprint
# You should then see a message saying "Welcome to GitLab, Jane Smith"
Configure your global gitignore file that Git uses it to determine which files and directories to ignore, before you make a commit. Open up a terminal amd run the following commands.
# copy the following text, then save and exit. ":wq"
### NetBeans ###
# Ignore paths that contain user-generated content
### Drupal Config ###
# Ignore configuration files that may contain sensitive information.
### Vim ###
### OSX ###
# Hidden files
# Temporary files
# Icon must end with two \r
# Files that might appear in the root of a volume
# Directories potentially created on remote AFP share
Network Trash Folder
### Windows ###
# Windows image file caches
# Folder config file
# Recycle Bin used on file shares
# Windows installer files
# Windows shortcuts
# Enter this command to initialize the ignore file.
git config --global core.excludesfile '~/.gitignore'