Flashcards · Git · Free
Git flashcards, generated for you.
Example Git study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Git flashcards
What does `git init` do?
Initializes a new Git repository in the current directory by creating a `.git` folder that stores all version control metadata.
What is the difference between `git add` and `git commit`?
`git add` stages changes to the index (staging area); `git commit` saves staged changes to the repository history with a message.
What command shows unstaged changes in your working directory?
`git diff` shows differences between the working directory and the staging area; `git diff --staged` shows staged vs. last commit.
What is HEAD in Git?
HEAD is a reference pointing to the currently checked-out commit, usually the tip of the current branch. It's stored in `.git/HEAD`.
What's the gotcha with `git push` if your local branch doesn't exist on the remote?
It will fail with 'no upstream branch.' Use `git push -u origin <branch>` to create and push to a remote tracking branch.
Explain the difference between `git merge` and `git rebase`.
`git merge` creates a merge commit combining two branches' histories; `git rebase` replays commits on top of another branch, rewriting history (don't rebase public branches).
What does `git reset --soft HEAD~1` do?
Undoes the last commit, moving it back to the staging area. Changes remain staged and ready to recommit. `--mixed` (default) also unstages; `--hard` discards changes.
What's the difference between `git revert` and `git reset`?
`git reset` moves HEAD backward, rewriting history (unsafe on public branches); `git revert` creates a new commit that undoes a past commit (safe for shared history).
What does `git stash` do, and how do you retrieve changes?
`git stash` temporarily saves uncommitted changes without committing. Retrieve with `git stash pop` (removes from stash) or `git stash apply` (keeps in stash).
Why should you avoid `git push --force` on shared branches?
Force push rewrites remote history, causing other developers' local branches to diverge and creating merge conflicts. Use `--force-with-lease` as a safer alternative that fails if remote changed.
Make your own Git study set
Flashcards for related topics
Studying Git to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →