Git and GitHub Workflows for Teams

Use Git with confidence on a team: clean commits, branches and merges, pull requests and reviews on GitHub, releases, and a way back from any mistake.

Beginner · Software Development · about 12 hours · 5 modules · certificate on completion

Taught by Agnieszka Kowalskà, Sebastiàn Vargàs, AI Learning Companions.

About this course

Git is how software teams keep track of every change and work on the same code without getting in each other's way. This course starts with what Git records and how to make clean, focused commits, then teaches branching, merging, resolving conflicts and rebasing on the command line, so you understand what the buttons in any tool are doing. You'll practise with remotes by playing two team members on one computer, then move to GitHub: pull requests, code review with suggestions, CODEOWNERS and protected branches, GitHub flow compared with trunk-based development, the three merge methods, and tagged, semantically versioned releases.

Every module has a lab in real repositories, some created for you by small scripts: a café menu with branches to merge and rebase, a shared remote with two clones, and a repository whose history needs repairing. The last module covers .gitignore, undoing almost anything with restore, reset, revert and the reflog, and automating checks with Git hooks. The capstone brings it all together in a small team project on GitHub, from the first commit to a release and a patch. Afterwards, CI/CD and Automated Testing builds automated pipelines on top of this workflow.

What you'll learn

  • Record work in small, well-described commits, and find answers in the history with log, show, diff and blame
  • Branch, merge and rebase with confidence, and resolve merge conflicts
  • Collaborate through remotes: fetch, pull and push, recover from rejected pushes, and share branches
  • Run a team workflow on GitHub with pull requests, code review, protected branches and a consistent merge method
  • Mark releases with semantic version tags and GitHub Releases, and patch old versions with cherry-pick
  • Undo mistakes safely with restore, reset, revert and the reflog, and automate checks with Git hooks

Skills you'll gain

Git, GitHub, Branching and merging, Rebasing, Resolving merge conflicts, Pull requests, Code review, Release management, Git hooks

Tools

Git, GitHub, GitHub CLI, Git Bash

Before you start

None beyond using a terminal: changing folders and running commands, as taught in Linux Command Line Essentials. Python Programming with PyCharm shows Git inside an IDE; this course goes further, on the command line and on GitHub. You need Git 2.28 or later (on Windows, Git for Windows, which includes Git Bash), a text editor, a free GitHub account, and the GitHub CLI (gh) for modules 3 and 4.

Modules

  1. Commits and history

    How Git records a project: the working tree, the staging area and commits; how to make small commits with clear messages; and how to search and read the history they build.

    • How Git records your work (12 min)
    • Making good commits (13 min)
    • Reading history (12 min)
    • Hands-on lab: Start a project's history
  2. Branches, merging and rebasing

    Work on several things at once with branches, bring work together with fast-forward and three-way merges, resolve conflicts calmly, and keep history tidy with rebase and interactive rebase.

    • Branches and HEAD (11 min)
    • Merging (12 min)
    • Resolving merge conflicts (13 min)
    • Rebasing and tidying history (14 min)
    • Hands-on lab: Merge, resolve and rebase a café menu
  3. Remotes and GitHub

    Share work through remotes: clone, fetch, pull and push, recover from a rejected push, share branches with teammates, and connect to GitHub with HTTPS or SSH, publish repositories and work with forks.

    • Remotes: clone, fetch, pull and push (14 min)
    • GitHub: access, repositories and forks (13 min)
    • Working on shared branches (12 min)
    • Hands-on lab: Collaborate through a shared remote
  4. Pull requests, reviews and releases

    Work as a team on GitHub: propose changes in pull requests, review them well, choose a workflow and a merge method, protect main, and mark releases with tags and GitHub Releases.

    • Pull requests (12 min)
    • Code review (13 min)
    • Team workflows and merge methods (13 min)
    • Tags and releases (13 min)
    • Hands-on lab: Take a change from pull request to release
  5. Ignore, undo and automate

    Keep the wrong files out with .gitignore, undo almost anything with restore, reset, revert and the reflog, and automate checks with Git hooks that the whole team shares.

    • .gitignore: keep the right files out (12 min)
    • Undoing changes: restore, reset, revert and the reflog (15 min)
    • Automating checks with Git hooks (12 min)
    • Hands-on lab: Put a messy repository right

Project: Run a team project on GitHub, from first commit to release

Set up and run a small project the way a professional team would, on GitHub. Choose something small to build or write, such as a recipe collection, a study guide or a short script. Work with a partner if you can, each with your own account, or alone with two clones of your own. Write a CONTRIBUTING.md that describes your workflow (GitHub flow or trunk-based development, branch names, commit message rules, how reviews work and which merge method you use), and add a .gitignore, a pull request template, a CODEOWNERS file and a commit-msg hook shared through core.hooksPath. Protect main so changes need a pull request. Then do the work through issues and at least three pull requests: one that resolves a merge conflict, one tidied with an interactive rebase before review, and one improved in response to review comments. Finish by tagging v1.0.0 with an annotated tag, publishing a GitHub Release with notes, and making a v1.0.1 patch on a release branch with a cherry-picked fix.

Part of

The products this course names are trademarks of their owners, who haven't made or endorsed it.

Start the course free