Git tutorials
The Git commands you actually use, in the order you will need them. Each tutorial gives the short answer first, then the real commands, the mistakes people make, and the same task in Gitoryx.
34 tutorialsBeginner to advancedUpdated
Set up
Configure Git once, get a repository onto your machine, and open it.
5 tutorials · 33 min
- Git Config: How to Configure Git for Your WorkflowBeginner · 8 minBefore writing your first commit, Git needs to know who you are. git config controls everything from your identity to your preferred editor, merge strategy, and custom aliases. This guide covers local, global, and system-level configuration.
- Git Init: Start a New Repository From ScratchBeginner · 6 mingit init turns any folder into a Git repository. This tutorial covers creating the repository, naming the first branch, making your first commit, connecting a remote, and the mistakes that create nested repositories.
- Git Clone: How to Copy a RepositoryBeginner · 8 mingit clone is how you download a repository to your local machine. This tutorial explains the different cloning methods, options like depth and branch selection, and how to handle common issues.
- Gitignore: Keep Files Out of Your RepositoryBeginner · 7 minA .gitignore file tells Git which files never to track. This tutorial covers pattern syntax, how to untrack files that were already committed, debugging rules, and using a global ignore for personal files.
- Open a Repository from the Terminal with GitoryxBeginner · 4 minEvery visual Git client worth its salt has a CLI shortcut: fork ., code ., gitkraken ., and now Gitoryx does too. This guide shows you how to install and use the `gitoryx` command to open repositories instantly from your terminal.
Save your work
The loop you will run every day: check, stage, commit, review.
6 tutorials · 48 min
- Git Status: How to Check the State of Your RepositoryBeginner · 7 mingit status is the most frequently typed Git command, and the most skipped by beginners. This tutorial explains every section of the output, the short format, and how to use it before every commit to avoid mistakes.
- Git Add: How to Stage Changes Before a CommitBeginner · 7 mingit add is the first step in every Git commit workflow. This tutorial explains how staging works, how to add specific files or hunks, and how to avoid the common mistake of committing unwanted changes.
- Git Commit: The Complete Beginner's GuideBeginner · 9 minA commit is the fundamental unit of Git history. This guide explains what happens when you commit, how to write useful messages, and how to fix mistakes: everything a beginner needs to build good habits from day one.
- Git Diff: See What Changed Before You CommitBeginner · 8 mingit diff is your window into what has changed in your repository. This tutorial explains how to compare staged vs unstaged changes, diff between branches and commits, and how to read the unified diff format.
- Git Log: How to Browse Your Commit HistoryBeginner · 9 mingit log is your window into the full history of a project. This tutorial covers the essential flags: --oneline, --graph, --all, --author, --since, and shows how to turn raw log output into a readable, filterable audit trail.
- Git Stash Tutorial: Save Work Without CommittingBeginner · 8 minGit stash is one of the most useful commands for switching tasks without losing your work. This tutorial explains how to stash, list, apply, and drop stashes with practical examples.
Branch and merge
Work in parallel, then bring the work back together without losing any of it.
5 tutorials · 49 min
- Git Branch: Create, Switch, and Manage BranchesBeginner · 9 minBranches are the foundation of every Git workflow. This tutorial covers creating and switching branches, understanding HEAD, deleting stale branches, and working with remote branches, all with practical examples.
- Git Checkout: Switch Branches, Files, and CommitsBeginner · 9 mingit checkout is one of Git's most versatile commands. This guide covers switching branches, checking out specific commits (detached HEAD), restoring individual files, and how the newer git switch and git restore commands relate to it.
- How to Resolve Merge Conflicts in GitBeginner · 12 minMerge conflicts are one of the most common pain points for Git users. This guide walks you through every step: detecting, understanding, and resolving conflicts, whether you prefer the CLI or a visual Git GUI like Gitoryx.
- Git Rebase vs Merge: What's the Difference?Intermediate · 10 minChoosing between rebase and merge is one of the most debated topics in Git. This guide explains the difference, shows real examples, and helps you decide which approach fits your workflow.
- Git Cherry Pick Tutorial: Apply Specific CommitsIntermediate · 9 minCherry-picking lets you apply any commit from any branch to your current branch, without merging everything. This tutorial shows you exactly how to use it, and when not to.
Share with your team
Connect to a remote, pull what others pushed, push what you built.
4 tutorials · 31 min
- Git Remote: Connect Your Repo to a Remote ServerBeginner · 8 minA Git remote is a reference to a copy of your repository hosted elsewhere: GitHub, GitLab, Bitbucket, or your own server. This guide explains how to add, inspect, rename, and remove remotes, and how remote tracking branches work.
- Git Fetch: See Remote Changes Before You MergeIntermediate · 7 mingit fetch downloads remote changes without touching your files or branches. This tutorial explains fetch versus pull, how to inspect what is incoming, and how to merge or rebase once you are ready.
- Git Pull: Sync Your Branch with the RemoteBeginner · 8 mingit pull keeps your local branch in sync with the remote. This tutorial explains what pull actually does (fetch + merge or rebase), when to prefer git fetch, and how to handle conflicts that arise during a pull.
- Git Push: Upload Your Commits to a Remote RepositoryBeginner · 8 mingit push sends your local commits to a remote repository, making them available to your teammates. This guide covers standard pushes, setting upstream branches, force pushing safely, and what to do when a push is rejected.
Undo and repair history
Take back a commit, rewrite a messy branch, and find the commit that broke things.
7 tutorials · 68 min
- How to Undo a Commit in Git (The Right Way)Beginner · 10 minEveryone needs to undo a commit at some point. This guide covers every safe way to do it: whether the commit is local, already pushed, or deep in history.
- Git Reset: Undo Changes at Any StageBeginner · 10 mingit reset is one of Git's most powerful, and most misunderstood, commands. This guide explains the three modes (--soft, --mixed, --hard), when each is safe to use, and how to recover if you go too far.
- Git Reflog: Recover Lost Commits and BranchesIntermediate · 7 mingit reflog is Git's safety net. This tutorial shows how to read it, find commits that disappeared after a reset or rebase, restore deleted branches, and why you should recover before entries expire.
- Git Revert: How to Safely Undo a Pushed CommitBeginner · 9 mingit revert is the safe way to undo a commit that has already been pushed. Instead of rewriting history like git reset, it creates a new commit that reverses the changes, so the undo itself becomes part of the record.
- Interactive Rebase Guide: Clean Up Your Git HistoryAdvanced · 13 minInteractive rebase is the most powerful tool for rewriting your commit history. This guide covers squashing, rewording, dropping, and reordering commits, step by step.
- How to Squash Commits in GitIntermediate · 8 minSquashing combines several commits into one clean commit. This tutorial shows three methods (soft reset, interactive rebase, merge --squash), how to push safely with force-with-lease, and what to avoid on shared branches.
- Git Bisect: Find the Commit That Broke Your CodeIntermediate · 11 mingit bisect uses binary search to pinpoint the exact commit that introduced a regression. Instead of checking hundreds of commits manually, it narrows the culprit down in logarithmic time. This guide shows you how: from the basics to full automation.
Team workflow
Branching models, commit conventions, hooks, and releases for a whole team.
7 tutorials · 77 min
- Git Branching Strategy: A Complete GuideIntermediate · 14 minA solid Git branching strategy is the backbone of any professional development workflow. This guide covers everything from basic branch creation to team-wide strategies like GitFlow and trunk-based development.
- GitFlow Explained: The Classic Branching ModelIntermediate · 11 minGitFlow is a structured Git workflow built around feature, develop, release, and hotfix branches. This guide explains every component and helps you decide if GitFlow is right for your team.
- Git Commit Conventions: Conventional Commits & GitmojiIntermediate · 11 minA consistent commit message format makes your Git history readable, enables automatic changelogs, and improves collaboration. This guide covers the Conventional Commits specification (feat, fix, chore, docs, refactor…), Gitmoji, and how to enforce standards in your team with hooks and tooling.
- Why You Should Switch to Gitmoji (Instead of feat/fix/chore)Intermediate · 9 minfeat, fix, and chore have become the default commit prefix for most teams. They work, but they're slow to scan and easy to ignore. Gitmoji replaces dry text labels with emoji that carry instant visual meaning: one glance tells you whether a commit fixed a bug, added a feature, or refactored code. This tutorial makes the case for switching, and shows you how.
- Git Hooks: Automate Actions at Key Points in Your WorkflowIntermediate · 11 minGit hooks are scripts that run automatically at specific points in the Git workflow: before or after commits, pushes, and merges. This tutorial shows you how to create and use hooks to enforce code quality, lint code, run tests, and automate repetitive tasks.
- Git Tag: Mark Releases and Milestones in Your HistoryBeginner · 8 minGit tags let you permanently mark specific commits: typically releases or milestones. This tutorial covers creating lightweight and annotated tags, listing and pushing them, and the most common mistake developers make: forgetting that git push doesn't send tags automatically.
- Git Changelog & Sprint Visualization: Track What ShipsIntermediate · 13 minA good changelog tells the story of your software. A sprint visualization shows what actually shipped. This guide covers generating changelogs from Git history, using tags for releases, and visualizing commit activity across a sprint, all without leaving your Git workflow.