git Course · 61 lessons · approx. 418 minutes

Learn Git & GitHub

Git stores the history of your projects. GitHub connects teams. Short explanation pages lead to checkable command exercises; these exercises do not run any Git commands.

  • Git is a version history
  • Checking the status
  • Stage a file
  • Saving a commit
  • Reading the history
  • Comparing changes
  • Working on a branch
  • Merging branches
  • Keeping secrets out
  • Connecting GitHub
  • Pull requests and collaboration
  • Licences and responsible sharing
  • git log: reading the history
  • git diff: changes before saving
  • restore --staged: taking back a selection
  • remote -v: the connected repository
  • git stash: putting work aside for a moment
  • git tag: marking a version
  • git revert: safely undoing a commit
  • commit --amend: improving the last commit
  • git fetch and git pull: getting what's new
  • Branches in everyday work
  • Investigating history
  • Cleaning up and undoing
  • Working with remotes
  • Stashing and tagging
  • Fixing mistakes precisely
  • Git + Bash: saving projects in the terminal
  • Git + Bash: connecting the tools

What you’ll learn

  1. Chapter 1Local checkpoints – Explain first, then apply deliberately.
    Git is a version history · Checking the status · Stage a file · Saving a commit
  2. Chapter 2Branches and changes – Explain first, then apply deliberately.
    Reading the history · Comparing changes · Working on a branch · Merging branches
  3. Chapter 3GitHub and responsibility – Explain first, then apply deliberately.
    Keeping secrets out · Connecting GitHub · Pull requests and collaboration · Licences and responsible sharing
  4. Chapter 4Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
    git log: reading the history · git diff: changes before saving · restore --staged: taking back a selection · remote -v: the connected repository
  5. Chapter 5Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
    git stash: putting work aside for a moment · git tag: marking a version · git revert: safely undoing a commit · commit --amend: improving the last commit · git fetch and git pull: getting what's new
  6. Chapter 6Branches in everyday work – Create and merge branches, resolve conflicts and rebase commits.
    A new branch with switch -c · A conflict while merging · Resolving the conflict · Rebasing with rebase · Boss: a feature from start to finish
  7. Chapter 7Investigating history – Use log, show, blame, reflog and diff to find out what happened when.
    log --oneline: the history at a glance · git show: looking at a commit · git blame: who wrote that? · reflog: rescuing lost commits · Boss: on the trail of a change
  8. Chapter 8Cleaning up and undoing – Read the short status, discard changes, take files out of Git, undo commits and clean up.
    Reading the short status · restore: discarding or unstaging · Taking files out of Git: rm --cached · reset --soft: taking back the last commit · Boss: cleaning up safely
  9. Chapter 9Working with remotes – Connect a repository to GitHub, upload, clone and stay up to date.
    Connecting a remote: git remote add · Uploading for the first time: push -u · Fetching a repository: git clone · Getting new work: fetch and pull · Boss: a feature for the pull request
  10. Chapter 10Stashing and tagging – Put unfinished work aside with stash and bring it back, mark versions with tags.
    Putting work aside: git stash · Bringing it back: git stash pop · Marking versions: git tag · Tags with a message: tag -a and push · Boss: a quick hotfix
  11. Chapter 11Fixing mistakes precisely – Improve the last commit, safely reverse commits, take over single commits and ignore files.
    Improving the last commit: --amend · Undoing safely: git revert · Taking over one commit: cherry-pick · Ignoring files: .gitignore · Boss: repairing without rewriting
  12. Chapter 12Git + Bash: saving projects in the terminal – Create folders and files with Bash commands, save every state with Git, use branches and merge them – all in the mini terminal.
    Starting a project: mkdir, cd, git init · Creating files and committing them · What changed? git status -s · A new idea on a branch · Boss: build a feature and merge it
  13. Chapter 13Git + Bash: connecting the tools – Evaluate Git output with pipes, create and exclude files with Bash, see branches in the file system – a whole project from the terminal.
    Evaluating the history: git log with wc and grep · What is still new? status -s with grep · Excluding files: .gitignore via echo · Branches in the file system: cat shows the state · Boss: a project entirely from the terminal

Final project: Your release plan

Check the status, stage changes and prepare a local commit.

How it works

Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.

Learn Git & GitHub now