Skip to main content
Git has a reputation for complexity, and it’s earned — there are hundreds of commands and entire books written about advanced workflows. For documentation work, though, you need fewer than ten concepts and maybe five commands. This lesson covers them.

Repository

A repository (usually shortened to “repo”) is where all your documentation files live. It contains every page, every image, every configuration file — and the complete history of every change ever made to any of them. When you use Mintlify, your documentation repository on GitHub is the source of truth for your live site. When changes are merged into the main branch of that repository, Mintlify detects them and rebuilds your site automatically.

Branch

A branch is a separate copy of your repository where you can make changes without affecting the live site. When you want to add a new page, fix an error, or reorganize a section, you create a branch, make your changes there, and then merge it back when you’re done. The main branch — usually called main — is what’s live on your Mintlify site at any given moment. Think of branches as a dedicated workspace. Your changes exist in isolation until you’re ready to share them.

Commit

A commit is a saved snapshot of your changes. When you’ve made edits you want to preserve, you commit them — which creates a record in the repository’s history with a description of what changed. A good commit message describes the change in plain terms: Add authentication quickstart or Fix broken link in API reference. This makes the history readable for your future self and your teammates. You can make multiple commits on a branch before opening a pull request. A series of small, focused commits is easier to review than one large commit that changes everything at once.

Pull request

A pull request (often abbreviated PR) is a formal proposal to merge your branch into main. Opening a PR triggers a few things:
  • Your teammates are notified and can review the changes
  • Mintlify generates a preview deployment — a live version of your docs with the changes applied
  • Any automated checks (broken link detection, style linting) run against your changes
A PR isn’t just a technical step — it’s a conversation. Reviewers can leave comments on specific lines, ask questions, and request changes before approving. Once the PR is approved and merged, your changes go live.

Merge

When a pull request is approved, you merge it. This takes the changes from your branch and applies them to main. Mintlify detects the merge and rebuilds your live site. After merging, it’s good practice to delete the branch you were working on — it’s served its purpose, and keeping branches around indefinitely creates clutter.

The five commands you’ll use most

If you work locally with the Mintlify CLI rather than through the web editor, these are the Git commands you’ll use most:
git checkout -b my-branch-name   # Create a new branch and switch to it
git add .                        # Stage all your changes for a commit
git commit -m "Your message"     # Save a snapshot with a description
git push origin my-branch-name   # Send your branch to GitHub
git pull                         # Bring in the latest changes from main
Everything else — rebasing, cherry-picking, interactive staging — you can learn later if and when you need it. These five will handle the vast majority of documentation work. Next up: Get connected — how to create your documentation repository, install the Mintlify GitHub app, and get your site live for the first time.