> ## Documentation Index
> Fetch the complete documentation index at: https://learn.mintlify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Git concepts

> Learn the small set of Git concepts behind the everyday documentation workflow.

export const Quiz = ({question, answers, correctFeedback, incorrectFeedback}) => {
  const [selected, setSelected] = React.useState(null);
  const [checked, setChecked] = React.useState(false);
  const quizId = React.useId();
  const isCorrect = checked && answers[selected]?.correct;
  const reset = () => {
    setSelected(null);
    setChecked(false);
  };
  return <div className={"quiz-container" + (checked ? " quiz-checked" : "")}>
      <Badge color="green">Quiz</Badge>
      <p className="quiz-question" id={quizId + "-question"}>{question}</p>
      <div className="quiz-options" role="radiogroup" aria-labelledby={quizId + "-question"} aria-disabled={checked}>
        {answers.map((answer, i) => <label key={i} className={["quiz-option", !checked && selected === i ? "quiz-option-selected" : "", checked && answer.correct ? "quiz-option-correct" : "", checked && selected === i && !answer.correct ? "quiz-option-incorrect" : ""].filter(Boolean).join(" ")}>
            <input type="radio" name={"quiz-" + quizId} checked={selected === i} onChange={() => !checked && setSelected(i)} disabled={checked} />
            <span className="quiz-radio" />
            <span className="quiz-option-label">{answer.text}</span>
          </label>)}
      </div>
      {checked && <div className={"quiz-feedback " + (isCorrect ? "quiz-feedback-correct" : "quiz-feedback-incorrect")} role="status" aria-live="polite" aria-atomic="true">
          <span className="quiz-feedback-icon">{isCorrect ? "✓" : "✗"}</span>
          {isCorrect ? correctFeedback : incorrectFeedback}
        </div>}
      <div className="quiz-actions">
        {!checked ? <button className="quiz-btn quiz-btn-check" type="button" onClick={() => selected !== null && setChecked(true)} disabled={selected === null}>
            Check answer
          </button> : <button className="quiz-btn quiz-btn-reset" type="button" onClick={reset}>
            Try again
          </button>}
      </div>
    </div>;
};

You don't need to master Git before editing documentation. Start with five ideas: repository, branch, working copy, commit, and pull request.

## Repository

A repository, usually shortened to “repo,” contains your documentation files and the history your team has committed.

Mintlify builds your site from a configured branch in that repository. Teams often use `main`, but the deployment branch can have another name.

## Branch and working copy

A branch is a line of work with its own version of the repository. A feature branch lets you prepare a change without updating the deployment branch.

Your working copy is the repository on your computer. Edits in your working copy aren't part of Git's history yet. You can inspect them, preview them, and decide what belongs in the next commit.

This distinction helps when Git reports a “modified” or “untracked” file: the file exists in your working copy, but you haven't committed its current state.

## Commit

A commit saves a selected set of changes to the branch's history. Its message should say what the change accomplishes, such as `Add authentication quickstart` or `Fix broken API reference link`.

Before committing, review the affected files with `git status` and the exact edits with `git diff`. Then stage only the files that belong together:

```bash theme={null}
git status
git diff
git add guides/authentication.mdx
git commit -m "Clarify authentication setup"
```

A commit is more useful when it represents one coherent change. It doesn't need to capture every edit you made during a work session.

## Pull request

A pull request, or PR, asks to merge one branch into another. It gives reviewers a focused diff and a place to discuss the change.

For a repository connected to Mintlify, a PR can also receive a preview deployment. Your team may configure additional checks, such as broken-link or style checks.

Approval requirements depend on the repository's branch protection rules. Some teams require reviews; others allow the author to merge after checking the preview.

## Merge

Merging applies the accepted changes to the target branch. When that target is your Mintlify deployment branch, the merge triggers a new deployment.

After the work is merged, the feature branch can usually be deleted. Its commits remain in the repository's history.

## Commands in context

The everyday local workflow uses a small set of commands:

```bash theme={null}
git switch main                         # Switch to the deployment branch
git pull --ff-only                      # Update it without creating a merge commit
git switch -c update-auth-guide         # Create and switch to a new branch
git status                              # See which files changed
git diff                                # Review unstaged edits
git add guides/authentication.mdx       # Select a file for the next commit
git commit -m "Update authentication"  # Save the staged change
git push -u origin update-auth-guide    # Publish the branch to GitHub
```

You don't need to memorize the list. The workflow lesson will put the commands in order and explain when to use each one.

<Quiz
  question="You've finished editing a guide on a feature branch and want a teammate to review it. What should you do after committing the change?"
  answers={[
{ text: "Push the branch to GitHub and open a pull request", correct: true },
{ text: "Switch to main and make the same edit again", correct: false },
{ text: "Send the edited file as an attachment", correct: false },
{ text: "Push the branch and wait for someone to find it", correct: false },
]}
  correctFeedback="Right. Pushing shares the branch with GitHub, and the pull request gives your teammate a diff, discussion, and preview to review."
  incorrectFeedback="Push the branch and open a pull request. The PR makes the proposed change visible and gives your teammate a clear place to review it."
/>

Next up: [Get connected](/courses/git-github/get-connected) — connect a documentation repository so Mintlify can deploy it.
