Git Cheatsheet
Searchable Git command reference with examples.
Loading tool...
Related Tools
About this tool
Searchable Git command reference with examples.
Searchable Git command reference with examples.
Searchable Git command reference with examples.
git config --global user.name "Name"Set usernamegit config --global user.email "email"Set emailgit initInitialize repogit clone <url>Clone remote repogit add .Stage all changesgit add <file>Stage specific filegit reset HEAD <file>Unstage filegit diff --stagedView staged changesgit commit -m "message"Commit with messagegit commit --amendAmend last commitgit log --onelineView commit historygit show <hash>Show commit detailsgit branchList branchesgit branch <name>Create branchgit checkout -b <name>Create & switchgit merge <branch>Merge branchgit rebase <branch>Rebase onto branchgit branch -d <name>Delete branchgit remote -vList remotesgit fetch originFetch changesgit pullPull & mergegit push origin <branch>Push branchgit push -u origin <branch>Push & trackgit stashStash changesgit stash popApply & remove stashgit stash listList stashesgit stash dropRemove stashgit revert <hash>Revert commitgit reset --soft HEAD~1Undo commit (keep changes)git reset --hard HEAD~1Undo commit (discard changes)git clean -fdRemove untracked files