🎓 A1Learner
🔍
0 of 50 lessons completed

Git Commands Reference

This lesson gathers the course’s commands in one place. Each row names the command, the job it does, and the lesson that teaches it.

One command to remember

The version command is the fastest check that Git is ready.

$ git --version

Example

$ git --version

Key points

  • Commands that save work sit at the top.
  • Commands that look at history sit in the middle.
  • Commands that share work sit near the end.
  • Keep this page open while you work.
  • The full course teaches every row here.

Here, the check prints the version. It is the first command to run on any new machine.

Try it Yourself

Edit the code, then press Run.

Running is simulated

The commands in this course

CommandJobLesson
git initStart a repositoryYour First Repository
git statusReport what changedCheck Status
git addStage changesStage Changes
git commitSave a snapshotMake a Commit
git logList snapshotsView the Log
git showOpen one snapshotInspect a Commit
git diffPrint changed linesCompare Changes with Diff
git blameName the snapshot per lineBlame a Line
git branchList, make, or delete branchesCreate a Branch
git switchMove between branchesSwitch Branches
git mergeJoin a branchMerge a Branch
git rebaseReplay work on a newer baseRebase a Branch
git cherry-pickCopy one snapshotCherry-Pick a Commit
git restoreThrow away or unstage changesUndo Unstaged Changes
git resetMove the branch pointer backUndo the Last Commit
git revertUndo a snapshot with a new oneRevert a Commit
git reflogList every move of the pointerRecover with Reflog
git stashPut work asideStash Your Work
git tagName one snapshotCreate a Tag
git remoteList remotesWhat Is a Remote
git cloneCopy a whole repositoryClone a Repository
git pushSend snapshots to the remotePush to GitHub
git pullBring new work from the remotePull Changes
git fetchDownload without joiningFetch Before You Pull

Exercise

Where do you look up a command you forgot?