Recommended - Shell install
🍎 macOS · 🐧 Linuxcurl -fsSL https://raw.githubusercontent.com/sahulkola/git-devkit/main/setup-aliases.sh | bashInstall quickly, learn the daily essentials, then explore the full reference.
Install the complete alias set globally on macOS, Windows, or Linux.
git aliases # list all configured aliases
git s # quick status
git lg # graph logThese are the most-used aliases for typical development flow.
git sstatus --short --branchFast status with current branch contextgit apadd --patchStage only the exact hunks you wantgit dsdiff --stagedReview staged changes before commitgit cmcommit -mCommit with an inline message quicklygit lglog --graph --pretty=...Visual graph log for quick history checksgit publishpush -u origin $(current branch)Push and track branch in one stepgit cancommit --amend --no-editAppend staged fixes to the last commitgit pfpush --force-with-leaseSafe force push after rebase or squashgit cleanupbranch --merged | xargs git branch -dClean up merged local branchesComplete list of all aliases grouped by category.
git sstatus --short --branchShort status with branch infogit ststatusFull statusgit cocheckoutCheckout branch or filegit cbcheckout -bCreate and switch to new branchgit brbranchList or manage branchesgit cicommitCommit staged changesgit cmcommit -mCommit with inline messagegit cacommit --amendAmend last commitgit cancommit --amend --no-editAmend without changing messagegit ddiffShow unstaged changesgit dsdiff --stagedShow staged changesgit aaddStage filesgit aaadd --allStage all changesgit apadd --patchInteractively stage hunksgit ffetch --all --pruneFetch all remotes and prunegit plpullPull from remotegit pspushPush to remotegit pfpush --force-with-leaseSafe force pushgit cpcherry-pickCherry-pick a commitgit lglog --graph --pretty=...Beautiful colored graph loggit lllog --oneline --decorate --all --graphAll branches one-line graphgit lastlog -1 HEAD --statShow last commit with statsgit todaylog --since=midnight --oneline --no-mergesCommits made todaygit weeklog --since='1 week ago' --oneline --no-mergesCommits made this weekgit contribshortlog --summary --numberedContributors ranked by commitsgit discardcheckout --Discard working directory changesgit brabranch -aList all branches (local + remote)git brdbranch -dDelete branch (safe)git brDbranch -DForce delete branchgit mergedbranch --mergedList merged branchesgit unmergedbranch --no-mergedList unmerged branchesgit cleanupbranch --merged | xargs git branch -dDelete all merged branchesgit gonefetch -p && branch -vv | grep goneFind branches with deleted remotesgit ssstash saveStash with a messagegit spstash popPop latest stashgit slstash listList all stashesgit sdstash dropDrop latest stashgit sastash applyApply stash without removinggit rvremote -vList remotes with URLsgit syncfetch --all --prune && pullSync with all remotesgit publishpush -u origin $(current branch)Push and track current branchgit unpublishpush origin --delete $(current branch)Delete current branch from remotegit wipadd -A && commit -m "WIP"Quick work-in-progress commitgit saveadd -A && commit -m "SAVEPOINT"Save all changes as checkpointgit donefetch && rebase origin/mainRebase on latest maingit aliasesconfig --get-regexp ^alias\.List all configured aliasesgit whoamiconfig user.name && user.emailShow current git identitygit rootrev-parse --show-toplevelShow repository root pathgit countrev-list --count HEADCount total commitsgit statsdiff --statShow file change statsgit whoshortlog -sneList all contributorsgit findls-files | grep -iFind file in repo by namegit ignoredls-files --others --ignored --exclude-standardList ignored filesgit untrackedls-files --others --exclude-standardList untracked filesgit conflictsdiff --name-only --diff-filter=UList conflicted filesgit ourscheckout --ours --Resolve conflict with our versiongit theirscheckout --theirs --Resolve conflict with their versiongit patchdiff > /tmp/patch.patchSave diff as patch filegit rirebase --interactiveInteractive rebasegit rcrebase --continueContinue rebase after resolvinggit rarebase --abortAbort current rebasegit fixupcommit --fixupCreate fixup commitgit autofixlog | fzf | commit --fixupInteractive fixup with fzf