Working with Git at uOttawa
Git is a version control tool for source code. This page does not cover the details of how to use git, only useful commands that you may need to know while working with our team. If you are new to Git, we recommend you read some of the documentation on their website before proceeding.
Getting Started with Git
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.
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
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.
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.
Overview
Repositories
Within uoWeb, there are many different repositories. Each repository contains a major module, some of which may contain other modules. It has been organized this way to allow for easy redistribution of just a part of uoWeb.
Once you have created a local build, you can find these repositories located in the following locations:
- profiles/uottawa
- This is the installation profile that manages how Drupal is installed for our distribution.
- sites/all/themes/custom/*
- This directory contains the custom themes that control the look & feel of the site.
- sites/all/modules/custom/*
- This directory contains modules that we have created and are considering sharing to the community.
- sites/all/modules/webcms/apps/*
- This directory contains modules that provide a new content type or other type of bundle to Drupal.
- sites/all/modules/webcms/widgets/*
- This directory contains modules that provide a new front-end widget for Drupal.
- sites/all/modules/webcms/config/*
- This directory contains modules that provide extra configuration for certain use cases or environments.
- sites/all/modules/webcms/examples/*
- This directory contains modules that provide example content and Selenium test cases.
Branches
Each project has a series of branches that are used for the release process. These eight branches are each tied to a stage in the continuous deployment workflow; generally, developers will not need to touch these branches unless they are preparing a hotfix late in the release cycle. Other branches can be created as well by developers, when working on a change.
- master
- This contains the latest code that has passed the code review process. It should be fairly stable but it has not yet been automatically tested.
- candidate
- This is a copy of the master branch that is made before we begin testing, to ensure that the code does not change between testing and updating the stable branch.
- stable
- This branch contains the latest version of master that has been through the hourly testing routine.
- dev
- This branch is built nightly and contains a more thoroughly tested version of the stable branch.
- qa
- This branch contains the code that is currently used on the QA environment's example site - this site will be used for accessibility testing and similar use cases that require a fully built site with a static URL.
- gold-qa
- This branch contains the code that is currently used in the QA environment.
- prod
- This branch contains the code that is currently used on the Production and Authoring environments' example sites.
- gold-prod
- This branch contains the code that is currently used in the Production environment.
Useful Git Commands
This section contains some useful Git commands that you might need to use sometimes.