Flashcards › Technology & Coding › Version Control
Git Commands
The Git commands and concepts developers use every day.
0 of 67 known
67 cards
- GitTask or termA version control system that tracks changes to files
- Repository (repo)Task or termA project folder tracked by Git
- Create a new repositoryTask or termgit init
- Copy a repositoryTask or termgit clone <url>
- See what has changedTask or termgit status
- Stage a fileTask or termgit add file.txt
- Stage everythingTask or termgit add .
- Commit staged changesTask or termgit commit -m 'message'
- CommitTask or termA saved snapshot of the project
- Commit messageTask or termA short note describing the change
- Staging area (index)Task or termWhere changes wait before committing
- Working directoryTask or termYour project files as they currently are
- View historyTask or termgit log
- View history brieflyTask or termgit log --oneline
- See changes not yet stagedTask or termgit diff
- See staged changesTask or termgit diff --staged
- BranchTask or termA separate line of work
- List branchesTask or termgit branch
- Create a branchTask or termgit branch name
- Switch branchTask or termgit switch name
- Create and switch to a branchTask or termgit switch -c name
- Old switch commandTask or termgit checkout name
- Merge a branchTask or termgit merge name
- Merge conflictTask or termWhen Git can't combine changes automatically
- Resolve a conflictTask or termEdit the file, remove markers, then add and commit
- Delete a branchTask or termgit branch -d name
- main branchTask or termThe default primary branch
- RemoteTask or termA copy of the repository on a server
- OriginTask or termThe usual name of the main remote
- Add a remoteTask or termgit remote add origin <url>
- Show remotesTask or termgit remote -v
- Send commits to a remoteTask or termgit push
- First push of a branchTask or termgit push -u origin name
- Get new commits from remoteTask or termgit fetch
- Fetch and merge from remoteTask or termgit pull
- Undo staging of a fileTask or termgit restore --staged file
- Discard local changes to a fileTask or termgit restore file
- Undo the last commit but keep changesTask or termgit reset --soft HEAD~1
- Make a new commit that undoes a commitTask or termgit revert <hash>
- Fix the last commit messageTask or termgit commit --amend
- Temporarily save changesTask or termgit stash
- Bring back stashed changesTask or termgit stash pop
- Tag a commitTask or termgit tag v1.0
- HEADTask or termA pointer to the current commit
- HashTask or termThe unique ID of a commit
- RebaseTask or termMove commits onto a new base for a straight history
- Cherry-pickTask or termCopy one commit onto another branch
- ForkTask or termYour own copy of someone else's repository
- Pull request (PR)Task or termA request to merge your branch into another
- Code reviewTask or termTeammates read and comment on changes
- GitHubTask or termA website hosting Git repositories
- GitLabTask or termAnother site for hosting Git repositories
- IssueTask or termA task or bug report on GitHub
- Clone vs forkTask or termClone copies to your computer; fork copies to your account
- READMETask or termA file describing a project
- LicenseTask or termA file saying how others may use the code
- GitignoreTask or termA file listing what Git should not track
- Linus TorvaldsTask or termCreated Git in 2005
- DiffTask or termThe difference between two versions of files
- BlameTask or termgit blame shows who last changed each line
- BisectTask or termgit bisect finds the commit that introduced a bug
- Detached HEADTask or termBeing on a commit that is not at the tip of a branch
- Force pushTask or termgit push --force overwrites remote history; use with great care
- Never commitTask or termPasswords, tokens or secret keys
- Commit oftenTask or termSmall commits are easier to understand
- Feature branchTask or termA branch made for one new feature
- Continuous integration (CI)Task or termTests run automatically when code is pushed
Download this deck
- CSVExcel, Google Sheets, Numbers
- Anki / Quizlet (tab-separated)Import straight into Anki or Quizlet
- JSONFor programmers and apps
- Plain textOne card a line, “front : back”, ready for Peabody's flashcard maker to print
Want paper cards? Paste the plain-text download into the flashcard maker.