---
tags: teaching, swd2
---
# 2021-11-11 <br> SWD2: Version Control with Git/ GitHub
Welcome to the hack pad for SWD2 course from Research Computing at the University of Leeds!
You can edit this document using [Markdown syntax](https://guides.github.com/features/mastering-markdown/).
## Contents
1. [Links to resource](#Links-to-resources)
2. [Agenda](#Agenda)
3. [Pre workshop prep](#Pre-workshop-prep)
4. [What's your name and where do you come from?](#What’s-your-name-and-where-do-you-come-from)
5. [Code along](#Code-along)
## Links to resources
- **Contact Research Computing** - https://bit.ly/arc-help
- **Request HPC account** - https://leeds.service-now.com/it?id=sc_cat_item&sys_id=4c002dd70f235f00a82247ece1050ebc
- **Presentation for today** - https://arctraining.github.io/swd2_git/
- **GitHub** - https://github.com/
- **Using GitHub via the web interface** - https://github.com/YaleDHLab/lab-workshops/tree/master/intro-to-git
## Pre workshop prep
This workshop is a hands on workshop so you will be expected to do some typing today!
To help get you up to speed please do the following prep:
1. Register for an account with GitHub (we'd encourage with your University email) via https://github.com/join

2. Make sure you have access to a terminal/shell with git installed
- If you're using a Mac/Linux machine you're all set! (These come with a terminal and git installed already)
- If you're using Windows you'll need to do the following:
1. Install Anaconda, [click here to download the installer](https://repo.anaconda.com/archive/Anaconda3-2020.11-Windows-x86_64.exe) (watch this video guide - https://mymedia.leeds.ac.uk/Mediasite/Play/09302f838ced49af803054090c449b331d?autoStart=false)
2. Once installed open the Anaconda prompt

3. From the Anaconda prompt install git-bash using the command `conda install -c conda-forge git-bash==2.22.0` type `y` when prompted

4. Once installed successfully, type `git-bash` into Anaconda prompt

A new terminal should then appear

And you've successfully installed git-bash 🎉
5. To make it easier to start in the future pin it to your taskbar

**You're now all set for SWD2!**
## Agenda Day 1
| Time | Agenda |
| -------- | ------------------------------------------ |
| 0900 | Intro, setup, what is version control? |
| 0950 | Break |
| 1000 | Creating a repository, Tracking changes |
| 1050 | Break and Answers |
| 1100 | Exploring history, GitHub, collaboration |
| 1150 | Questions |
| 1200 | Close |
## Agenda Day 2
| Time | Agenda |
| -------- | ------------------------------------------ |
| 0900 | Intro, collaborating (cont.), Conflicts |
| 0950 | Questions and break |
| 1000 | Conflicts and Branching |
| 1050 | Questions and break |
| 1100 | Open Science, Licensing |
| 1150 | Wrap up and questions |
| 1200 | Close |
## What's your name and where do you come from?
- Lorenzo Barba, School of Chemical and Process Engineering: Need help from Git/GitHub for OpenFOAM coding.
- Martin Callaghan, Research Computing
- Smail Kechidi, School of Civil Engineering, Learn Github version control
- John Hodrien, Research Software Engineer and lover of Linux and Git
- Lena AlMutair, PhD student In school of computing
- Kristina Bratkova, LIDA, Data Scientist Intern, using GitHub for the project but I would like to understand it and use effectively
- Menwa Alshammeri, School of Computing:I use Github to keep track of my codes and models, and manage updates effeciently.
- Eran Livne, PhD at LIDA, Looking to arrange my data and software in a smart way
- Colin Everett, LICTR. To better manage updates to some programs I write
- Johanna Tomczak, PhD student in School of Psychology, to learn about version control for my data visualisation
- Kalila Cook, School of Physics and Astronomy
- Abrar, PhD student,School of Computing. I need Github to save my work on!
- David Palma, Institute for Transport Studies, Research Fellow. Here to stop using Dropbox to share code.
- Joanna Egan, School of Chemistry, I have to use large atmospheric models and I don't want to break them
- Brooke Snoll, School of Earth and Environment; here to learn more about efficient programming and reproducibility
- Aiden Daniel, School of Physics and Astronomy. Here to learn how to better manage my research in order to share it with my colleagues
- Thiago Falcão - PhD student - School of Earth and Environment - Development of small tools, so version it in a proper way would be great.
- Duncan Ewin - PhD student Microbiology
- Shatha Altammami - PhD student- school of computing.
- Andrew Pretorius, SOEE, Developing machine learning methods to detect glacial seismicity, fed up with messy folders full of scripts
- Yousef Alghamdi, Phd student, moving into group projects.
- Annah Muli , PhD student, interested in coding and version control.
- Hanan Dreiwi, postdoc- school of Mathematics
### Code along
### Git Config
When we start using git it's helpful to set some defaults using the following commands:
```bash=
$ git config --global user.name "<your name>"
$ git config --global user.email "<your email>"
$ git config --global color.ui "auto"
$ git config --global init.defaultBranch main
$ git config --global core.editor "nano -w"
# if on windows
$ git config --global core.autocrlf true
```
### Creating an SSH Key
Steps are outlined on [GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) very nicely.