Flashcards › Technology & Coding › Version Control

Git Commands

The Git commands and concepts developers use every day.

67 cardsGrades 9–12, College, Adult#Git#version control#GitHub

0 of 67 known
67 cards
  • GitTask or term
    A version control system that tracks changes to files
  • Repository (repo)Task or term
    A project folder tracked by Git
  • Create a new repositoryTask or term
    git init
  • Copy a repositoryTask or term
    git clone <url>
  • See what has changedTask or term
    git status
  • Stage a fileTask or term
    git add file.txt
  • Stage everythingTask or term
    git add .
  • Commit staged changesTask or term
    git commit -m 'message'
  • CommitTask or term
    A saved snapshot of the project
  • Commit messageTask or term
    A short note describing the change
  • Staging area (index)Task or term
    Where changes wait before committing
  • Working directoryTask or term
    Your project files as they currently are
  • View historyTask or term
    git log
  • View history brieflyTask or term
    git log --oneline
  • See changes not yet stagedTask or term
    git diff
  • See staged changesTask or term
    git diff --staged
  • BranchTask or term
    A separate line of work
  • List branchesTask or term
    git branch
  • Create a branchTask or term
    git branch name
  • Switch branchTask or term
    git switch name
  • Create and switch to a branchTask or term
    git switch -c name
  • Old switch commandTask or term
    git checkout name
  • Merge a branchTask or term
    git merge name
  • Merge conflictTask or term
    When Git can't combine changes automatically
  • Resolve a conflictTask or term
    Edit the file, remove markers, then add and commit
  • Delete a branchTask or term
    git branch -d name
  • main branchTask or term
    The default primary branch
  • RemoteTask or term
    A copy of the repository on a server
  • OriginTask or term
    The usual name of the main remote
  • Add a remoteTask or term
    git remote add origin <url>
  • Show remotesTask or term
    git remote -v
  • Send commits to a remoteTask or term
    git push
  • First push of a branchTask or term
    git push -u origin name
  • Get new commits from remoteTask or term
    git fetch
  • Fetch and merge from remoteTask or term
    git pull
  • Undo staging of a fileTask or term
    git restore --staged file
  • Discard local changes to a fileTask or term
    git restore file
  • Undo the last commit but keep changesTask or term
    git reset --soft HEAD~1
  • Make a new commit that undoes a commitTask or term
    git revert <hash>
  • Fix the last commit messageTask or term
    git commit --amend
  • Temporarily save changesTask or term
    git stash
  • Bring back stashed changesTask or term
    git stash pop
  • Tag a commitTask or term
    git tag v1.0
  • HEADTask or term
    A pointer to the current commit
  • HashTask or term
    The unique ID of a commit
  • RebaseTask or term
    Move commits onto a new base for a straight history
  • Cherry-pickTask or term
    Copy one commit onto another branch
  • ForkTask or term
    Your own copy of someone else's repository
  • Pull request (PR)Task or term
    A request to merge your branch into another
  • Code reviewTask or term
    Teammates read and comment on changes
  • GitHubTask or term
    A website hosting Git repositories
  • GitLabTask or term
    Another site for hosting Git repositories
  • IssueTask or term
    A task or bug report on GitHub
  • Clone vs forkTask or term
    Clone copies to your computer; fork copies to your account
  • READMETask or term
    A file describing a project
  • LicenseTask or term
    A file saying how others may use the code
  • GitignoreTask or term
    A file listing what Git should not track
  • Linus TorvaldsTask or term
    Created Git in 2005
  • DiffTask or term
    The difference between two versions of files
  • BlameTask or term
    git blame shows who last changed each line
  • BisectTask or term
    git bisect finds the commit that introduced a bug
  • Detached HEADTask or term
    Being on a commit that is not at the tip of a branch
  • Force pushTask or term
    git push --force overwrites remote history; use with great care
  • Never commitTask or term
    Passwords, tokens or secret keys
  • Commit oftenTask or term
    Small commits are easier to understand
  • Feature branchTask or term
    A branch made for one new feature
  • Continuous integration (CI)Task or term
    Tests run automatically when code is pushed

Download this deck

Want paper cards? Paste the plain-text download into the flashcard maker.