Summary and Schedule
This is a new lesson built with The Carpentries Workbench.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Introduction to Git |
What is Git? What problem does it solve? |
| Duration: 00h 21m | 2. Why use Git? | Why use version control? |
| Duration: 00h 41m | 3. Fundamental concepts |
What are the fundamental concepts of version control? What are commits? What are remotes? What is the staging area? What are branches? |
| Duration: 01h 01m | 4. Your first Git repository |
How do we create a Git repository? What are some of the basic Git commands? |
| Duration: 01h 22m | 5. Tracking changes |
How do we create a Git repository? What are some of the basic Git commands? |
| Duration: 01h 42m | 6. Remotes: pushing and pulling |
How do we interact with Git remotes? What does pushing and pulling mean? |
| Duration: 02h 02m | 7. Cloning a repository |
How do we collaborate with Git? How do we get code from GitHub into our computer? How do we revert changes that we do not want? |
| Duration: 02h 24m | 8. Forking a repository |
What does forking a repository mean? What is a merge conflict? |
| Duration: 02h 47m | 9. Tips and best practices |
How do we incorporate Git into our everyday work? What are some tips and best practices for working with Git? |
| Duration: 03h 07m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Please follow the steps below and install the required software before the scheduled workshop.
Software Setup
We use VS Code for general coding. Make sure to install VS Code for your operating system following the instructions below:
Windows users
If you are a Windows user, you may also need WSL, the Windows Subsystem for Linux. WSL will allow you to use the Terminal from within VS Code and to execute UNIX style commands.
Follow the official instructions here.
After installing WSL, you will also need to install GitBash.
After installing GitBash, change the default Terminal executable on VS Code:
- Open VS Code.
- From the
Viewmenu selectCommand Palette --> Terminal: Select Default Profile. - Select
GitBashas the default profile.
✅ You’re all set to use VS Code with GitBash on Windows.
Installing Git
Windows users will need to install GitBash which is a
linux-like terminal that comes pre-installed with Git.
You will use conda from within the GitBash
shell to manage environments and software instalation.
- Install GitBash
Windows checks:
- Open the
GitBashterminal app. - Check for
(base)prefix in your prompt. - If
(base)is not present, open the “miniforge prompt” app and runconda init bash - Open a new
GitBashterminal session. - Run
conda --version - Run
git --version
Open the Terminal app and run git --version. You may be
prompted to install git.
Note: You may be prompted to install Xcode which will take some time.
Your Linux distribution likely comes with Git. If not, click here and follow the instructions.
Configure Git
If you are setting up Git for the first time, you will need to set your user name and email.
IMPORTANT:
- You must use same email as your github account.
- You should use an email address that you will always have access to (not a work or university address).
BASH
git config --global user.name "Alfredo Linguini"
git config --global user.email "a.linguini@gmail.com"
Please use your own name and email address instead of Alfredo’s. And make sure you use the same email associated with your GitHub account.
We will also set the default editor as nano.
Setup Github
Create a GitHub account
Create a new account at GitHub.com if you do not have one.
Again, use an email address that you will always have access to (not a work or university address).
Configure SSH access
If you do not have ssh set up for git create a new ssh key and add the key to your github account.
Note: On windows you should do this from the GitBash shell.
To confirm that your key is correctly configured run:
Environment management with conda
For certain workshops, you may need to install conda, an open-source software and package management system. This is usually necessary when working with Python code.
Our preferred flavour of conda is miniforge, but you could also use miniconda.
Click here and follow the miniforge installation instructions for your OS.