Git: A version control system that tracks changes to files Repository (repo): A project folder tracked by Git Create a new repository: git init Copy a repository: git clone See what has changed: git status Stage a file: git add file.txt Stage everything: git add . Commit staged changes: git commit -m 'message' Commit: A saved snapshot of the project Commit message: A short note describing the change Staging area (index): Where changes wait before committing Working directory: Your project files as they currently are View history: git log View history briefly: git log --oneline See changes not yet staged: git diff See staged changes: git diff --staged Branch: A separate line of work List branches: git branch Create a branch: git branch name Switch branch: git switch name Create and switch to a branch: git switch -c name Old switch command: git checkout name Merge a branch: git merge name Merge conflict: When Git can't combine changes automatically Resolve a conflict: Edit the file, remove markers, then add and commit Delete a branch: git branch -d name main branch: The default primary branch Remote: A copy of the repository on a server Origin: The usual name of the main remote Add a remote: git remote add origin Show remotes: git remote -v Send commits to a remote: git push First push of a branch: git push -u origin name Get new commits from remote: git fetch Fetch and merge from remote: git pull Undo staging of a file: git restore --staged file Discard local changes to a file: git restore file Undo the last commit but keep changes: git reset --soft HEAD~1 Make a new commit that undoes a commit: git revert Fix the last commit message: git commit --amend Temporarily save changes: git stash Bring back stashed changes: git stash pop Tag a commit: git tag v1.0 HEAD: A pointer to the current commit Hash: The unique ID of a commit Rebase: Move commits onto a new base for a straight history Cherry-pick: Copy one commit onto another branch Fork: Your own copy of someone else's repository Pull request (PR): A request to merge your branch into another Code review: Teammates read and comment on changes GitHub: A website hosting Git repositories GitLab: Another site for hosting Git repositories Issue: A task or bug report on GitHub Clone vs fork: Clone copies to your computer; fork copies to your account README: A file describing a project License: A file saying how others may use the code Gitignore: A file listing what Git should not track Linus Torvalds: Created Git in 2005 Diff: The difference between two versions of files Blame: git blame shows who last changed each line Bisect: git bisect finds the commit that introduced a bug Detached HEAD: Being on a commit that is not at the tip of a branch Force push: git push --force overwrites remote history; use with great care Never commit: Passwords, tokens or secret keys Commit often: Small commits are easier to understand Feature branch: A branch made for one new feature Continuous integration (CI): Tests run automatically when code is pushed Free flashcards from Peabody at peabody.kids/flashcards/tech-git-commands