Flashcardsfor IT Certifications

D1: Essential Git Commands

GH-900 GitHub Foundations exam practice questions · 12 flashcards

Question
git init?
1 / 12

Tip: Space flips the card, ← / → navigate.

Last updated: · Report an error on this page

Show all 12 Essential Git Commands practice questions and answers
  1. git init?
    Creates a new Git repository in the current folder.
  2. git clone <url>?
    Copies a remote repository with full history to your machine.
  3. git status?
    Shows modified, staged and untracked files.
  4. git add <file>?
    Stages changes for the next commit.
  5. git commit -m "msg"?
    Records staged changes as a new commit.
  6. git log?
    Shows commit history.
  7. git branch <name> / git switch <name>?
    Create a branch / switch to it (git switch -c creates and switches).
  8. git checkout?
    Older command to switch branches or restore files.
  9. git remote -v?
    Lists configured remotes.
  10. git revert <sha>?
    Creates a new commit that undoes a previous commit (safe for shared history).
  11. git reset?
    Moves branch pointer/unstages changes; --hard discards local changes (dangerous).
  12. git stash?
    Temporarily shelves uncommitted changes.