Summary and Schedule
This is a Byte-Sized RSE lesson on intermediate Git, part of the Byte-Sized RSE Series.
Learning Objectives
At the end of this lesson, learners should be able to:
- Understand the purpose and benefits of using Git branches in collaborative projects, especially the feature branch workflow.
- Compare Git merging strategies (fast-forward, 3-way merge, rebase, squash and merge) and understand when to use each.
- Gain familiarity with intermediate Git features, including cherry-picking, stashing, and resetting.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Introduction |
What is a Git branch and why is it useful in collaborative
development? When should I create a new branch in my project? What are the differences between fast-forward merge, 3-way merge, rebase, and squash and merge? How does Git handle merging when branches have diverged? |
| Duration: 00h 15m | 2. Example Code |
What are Git “branches”? Why should I separate different strands of code work into “feature branches”? How should I capture problems with my code that I want to fix? |
| Duration: 00h 25m | 3. Feature Branch Workflow |
How do I use Git to create and work on a feature branch? How do I push my local branch changes to GitHub? |
| Duration: 00h 35m | 4. Creating a Pull Request | How can I organise a set of changes together so they can be merged later? |
| Duration: 00h 45m | 5. Merging a Pull Request |
How do I merge changes proposed within a pull request with the main
branch? What should I do with a branch that has been merged and is no longer required? |
| Duration: 00h 55m | 6. Resolving Merge Conflicts |
How should I manage conflicts when merging branches? How does GitHub help me manage merge conflicts with a pull request? |
| Duration: 01h 05m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Setup
- Shell with Git version control tool installed
- Ability to navigate filesystem and run commands from within a shell
- Account on GitHub.com
- Understanding of Python syntax to be able to read and follow code examples
Shell with Git
On macOS and Linux, some version of a shell (e.g. bash)
with Git will be available by default and no installation is needed.
If you do not have a bash shell installed on your system and require assistance with the installation, you can take a look at the instructions provided by Software Carpentry for installing shell and Git.
GitHub Account
GitHub is a free, online host for Git repositories that you will use during the course to store your code in so you will need to open a free GitHub account unless you do not already have one.