Summary and Setup

In this course you will be learning how to effectively collaborate with colleagues using Git and GitHub. Good working practices help us avoid mistakes, keep our codebases secure, and help us write sustainable code. Having clear practices for contributing to your repository encourages outside collaborators to contribute to your work. In this lesson we’ll look at what good practice using Git and GitHub might look like.

One process to develop new code with Git and GitHub looks like this:

  1. Open an Issue describing the feature or bug
  2. Create a branch to develop your changes on
  3. Make changes to your working copy
  4. Write tests
  5. Write documentation
  6. Open a Pull Request
  7. Review your changes
  8. Merge the Pull Request and close the Issue
  9. Tidy up your branches

During this workshop you will practice collaborating using a similar albeit simplified process on a test repository your instructors have set up. By the end of the course you should have the skills and knowledge to decide what working practices are best for you and your team.

Prerequisites

In this lesson we use Git from the Unix Shell. Some previous experience with the shell is expected, but isn’t mandatory.

This is a follow up course from the Version Control with Git lesson. Please ensure you are comfortable with the beginner material prior to starting this course.

Pre-workshop Survey


Please remember to fill out the pre-workshop survey prior to the start of the workshop. This information is vital for us to keep improving the lesson for other learners.

SSH Check


Run:

BASH

$ ssh -T git@github.com

If you DO NOT see the output:

OUTPUT

Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.

Please go back to the introduction lesson’s SSH setup instructions.

Single sign-on (SSO) Check


If you are part of an organisation that requires single sign-on (SSO) to access their GitHub organisation you will need to authorise the SSH key for use in the organisation.

Next to the SSH key in the GitHub settings click on “Configure SSO”. Find the organisation in the list and click on “Authorise”. If the key is already authorised, it will say “Deauthorise” instead, and nothing more needs to be done.

Full instructions on SSH key setup and SSO authorisation can be found in the introduction lesson’s SSH setup instructions.

Give Your GitHub Username to the Instructors


In this lesson you will be working on a new repository, called git-training-demo, which your instructors have set up for you. If you are working through this material as part of a workshop your instructors will ask you to provide them with your GitHub username, no other setup is required.

Failure to provide your GitHub username

If you do not provide your GitHub username to your instructors before the workshop your registration will be removed.

If you are working through this material in your own time you will need to be provided with repository permissions for Episodes 1-5. Met Office colleagues should request membership to the git-and-github-training GitHub team. Met Office partners should email the Science Git Migration Project with the subject: GH WP Training Permissions Request, please include your GitHub username in the email. Please be patient when you arrive at Episode 5 Review as you will need to wait for an instructor to review your changes.