Skip to main content
EasyPalmCards

Flash card deck22 cardsBeginnerAnyone

Git commands flash cards

Twenty-one flash cards on everyday Git commands: init, clone, add, commit, branch, merge, push, pull, stash and undoing changes, with what each one does.

Use this template Study now

Free to use, edit, print and study. No account needed: your set stays on this device.

The cards, front and back

  1. 1
    Front

    Git

    Back

    A version control system that records changes to files over time, so you can review history, work on branches and collaborate safely.

  2. 2
    Front

    Repository (repo)

    Back

    A project folder tracked by Git, including the full history of its changes.

  3. 3
    Front

    git init

    Back

    Creates a new, empty Git repository in the current folder.

  4. 4
    Front

    git clone [url]

    Back

    Copies an existing remote repository, with its full history, onto your computer.

  5. 5
    Front

    git status

    Back

    Shows which files have changed, which are staged for the next commit and which are not tracked.

  6. 6
    Front

    git add [file]

    Back

    Stages changes so they are included in the next commit. git add . stages every change in the current folder.

  7. 7
    Front

    git commit -m '[message]'

    Back

    Saves a snapshot of the staged changes with a message describing them.

  8. 8
    Front

    Staging area

    Back

    The middle step between your working files and the repository. You choose exactly what goes into each commit by staging it.

  9. 9
    Front

    git log

    Back

    Shows the commit history. git log --oneline gives a compact one-line-per-commit view.

  10. 10
    Front

    git diff

    Back

    Shows line-by-line changes that are not yet staged. git diff --staged shows changes that are staged.

  11. 11
    Front

    Branch

    Back

    An independent line of development. You can build a feature on a branch without affecting the main branch.

  12. 12
    Front

    git branch

    Back

    Lists branches. git branch [name] creates a new one.

  13. 13
    Front

    git switch [branch]

    Back

    Moves to another branch. git switch -c [name] creates a branch and switches to it. Older guides use git checkout for the same job.

  14. 14
    Front

    git merge [branch]

    Back

    Combines the history of another branch into the branch you are on.

  15. 15
    Front

    Merge conflict

    Back

    Happens when two branches change the same lines differently. Git marks the conflict in the file; you edit it, then add and commit to finish.

  16. 16
    Front

    Remote

    Back

    A version of the repository hosted elsewhere, such as on GitHub or GitLab. The default name is usually origin.

  17. 17
    Front

    git fetch

    Back

    Downloads new commits and branches from the remote without changing your own files or branch, so you can look at what changed before merging.

  18. 18
    Front

    git push

    Back

    Uploads your local commits to the remote repository.

  19. 19
    Front

    git pull

    Back

    Downloads changes from the remote and merges them into your current branch. It combines git fetch and git merge.

  20. 20
    Front

    git stash

    Back

    Puts uncommitted changes aside so you can switch tasks. git stash pop brings them back.

  21. 21
    Front

    git restore [file]

    Back

    Discards unstaged changes to a file, returning it to the last committed version. git restore --staged [file] unstages it instead.

  22. 22
    Front

    .gitignore

    Back

    A file listing files and folders Git should not track, such as passwords, build output or dependency folders.

How to use this template

This deck covers the Git commands you use every day, from creating and cloning a repository to staging, committing, branching, merging, pushing, pulling and undoing changes. It suits computing students, new developers, designers and writers who keep work in Git, and anyone starting on GitHub or GitLab. Square brackets show the parts you replace, such as a file name or branch. Study in Learn mode, then try each command in a practice repository. Switch to Test mode and let spaced repetition keep the commands at your fingertips, and print a double-sided copy to keep by your desk.

Tips

  • Make a throwaway practice repository and try every command. Mistakes there cost nothing.
  • Run git status before and after each command to see exactly what changed.
  • Write commit messages that say what changed and why, in a short phrase.
  • Pull before you start work and before you push, to reduce merge conflicts.
  • Never commit passwords or keys. Add those files to .gitignore from the start.

Make it fit

  • Add cards on git rebase, git cherry-pick and git reset for intermediate users.
  • Add your team's branch naming and pull request rules to the deck.
  • For a GitHub-focused class, add cards on forks, pull requests and issues.
  • Swap git switch and git restore for git checkout if your tools or course use the older commands.

Updated October 28, 2026