Asia/Calcutta
Posts

Porcelain vs Plumbing in Git

May 24, 2025
Git commands are divided into two categories: porcelain and plumbing. Understanding this distinction helps you know when to use a high-level shortcut versus when you need precise, low-level control.
CategoryPorcelain CommandsPlumbing Commands
LevelHigh-level (user-friendly)Low-level (internal, script-friendly)
AudienceEnd usersTools, scripts, Git internals
OutputReadable, formattedRaw, structured (for parsing)
StabilityStable, designed for daily useMay change, not always user-friendly
Tip: Porcelain = Pretty (what users interact with). Plumbing = Pipes (what Git is built on).

Porcelain commands are what you use every day. Git officially lists 44 main commands, split into three functional groups.
#CommandDescription
1git addAdd file contents to the index
2git amApply a series of patches from a mailbox
3git archiveCreate an archive of files from a named tree
4git bisectUse binary search to find the commit that introduced a bug
5git branchList, create, or delete branches
6git bundleMove objects and refs by archive
7git checkoutSwitch branches or restore working tree files
8git cherry-pickApply the changes from a specific commit
9git citoolGraphical alternative to git commit
10git cleanRemove untracked files from the working tree
11git cloneClone a repository into a new directory
12git commitRecord changes to the repository
13git describeDescribe a commit using the most recent tag
14git diffShow changes between commits, working tree, etc.
15git fetchDownload objects and refs from another repository
16git format-patchPrepare patches for e-mail submission
17git gcOptimize the local repository
18git grepSearch for patterns in files tracked by Git
19git guiLaunch Git's graphical interface
20git initCreate an empty Git repository
21git logShow commit logs
22git mergeJoin two or more development histories
23git mvMove or rename a file
24git notesAdd or inspect object notes
25git pullFetch from and integrate with another repository
26git pushUpdate remote refs and objects
27git rebaseReapply commits on top of another base tip
28git reflogShow history of HEAD or other references
29git remoteManage set of tracked repositories
30git resetReset current HEAD
31git restoreRestore working tree files
32git revertCreate a new commit to undo previous commits
33git rmRemove files from the working tree and index
34git shortlogSummarize git log output
35git showShow various types of objects
36git sparse-checkoutManage sparse-checkout of the working directory
37git stashStash the current state of the working directory
38git statusShow the working tree status
39git submoduleInitialize, update, or inspect submodules
40git switchSwitch branches
41git tagCreate, list, delete, or verify tags
42git worktreeManage multiple working trees
43git configGet and set repository or global options
44git helpGet help for a git command

Commands that modify repository state.
#CommandDescription
1git commitRecord changes to the repository
2git revertRevert a previous commit by creating a new commit
3git resetReset current HEAD and optionally index/working tree
4git mergeMerge another branch into the current branch
5git rebaseReapply commits on top of another base tip
6git cherry-pickApply changes introduced by existing commits
7git stashTemporarily save changes not ready to commit
8git applyApply a patch to files and/or the index
9git configSet repository or global options
10git reflogManage the reflog (can be used to recover commits)
11git replaceCreate, list, delete object replacement refs

Commands that read repository state without modifying it.
#CommandDescription
1git blameShow who last modified each line of a file
2git diffShow changes between commits, working directory
3git logShow the commit history
4git showShow information about a commit or object
5git reflogShow history of changes to references like HEAD
6git statusShow the working tree and staging area status
7git shortlogSummarize git log by author
8git describeDescribe a commit using the nearest tag
9git grepSearch through tracked files for a pattern
10git configView Git configuration values
11git remoteView remote connections
12git branchList branches
13git tagList tags
14git rev-parseConvert human-readable refs to SHA-1 hashes
15git cat-fileView object contents
16git ls-filesShow files in the index (staging area)
17git ls-treeList contents of a tree object

Commands that communicate with remote repositories or external systems.
#CommandDescription
1git cloneClone a remote repository into a new local directory
2git remoteManage and interact with remote repositories
3git fetchDownload commits, refs, and objects from a remote repository
4git submoduleInitialize, update, or sync submodules
5git request-pullGenerate a summary of changes for a pull request via email
6git archiveCreate an archive (tar/zip) of files from the repository
7git bundleCreate or fetch from a self-contained bundle of Git objects
8git send-emailSend patches as emails
9git p4Import from and submit to Perforce repositories
10git svnBidirectional operation between Subversion and Git

Plumbing commands are used by Git internally and in automation scripts. They provide fine-grained, predictable control over Git's object model. Commands that modify Git's internal objects and structures.
CommandDescription
git hash-objectCompute object ID and optionally create a blob from a file
git update-indexRegister file contents in the working directory to the index
git write-treeCreate a tree object from the current index
git commit-treeCreate a new commit object
git update-refUpdate the object name stored in a ref safely
git symbolic-refRead, modify, and delete symbolic refs
git mktreeBuild a tree object from stdin
git read-treeRead tree information into the index
git checkout-indexCopy files from the index to the working directory
git pruneRemove unreachable objects from the object database

Commands that retrieve information without modifying anything.
CommandDescription
git cat-fileProvide content, type, or size information for repository objects
git check-ignoreDetermine whether a path is ignored by .gitignore
git count-objectsCount unpacked objects and display repository statistics
git diff-filesCompare files in the working directory and the index
git diff-indexCompare content and mode of blobs between the index and a tree
git diff-treeShow differences between two tree objects
git for-each-refOutput information on each ref
git ls-filesShow information about files in the index and the working tree
git ls-treeList the contents of a tree object
git merge-baseFind common ancestors between two commits
git name-revFind symbolic names for given revisions
git rev-listList commit objects in reverse chronological order
git rev-parseParse revision (branch, tag, etc.) identifiers
git show-refList references in a local repository
git verify-packValidate packed Git archive files
git show-indexShow packed archive index
git fsckVerify the connectivity and validity of objects in the database
git describeDescribe a commit using the nearest tag
git logShow commit logs
git blameShow what revision and author last modified each line of a file
git shortlogSummarize git log output

Commands that handle data transfer between repositories.
CommandDescription
git fetch-packReceive a packfile from a remote repository
git send-packPush objects over Git protocol to another repository
git receive-packReceive what is pushed into the repository
git upload-packSend objects packed back to git-fetch-pack
git pack-objectsCreate a packed archive of objects

Low-level commands primarily used internally by other Git commands.
CommandDescription
git unpack-objectsUnpack objects from a packed archive
git index-packBuild pack index file for an existing packed archive
git unpack-fileCreate a temporary file with the contents of a blob
git applyApply a patch to files and/or the index
git mailinfoExtract patch and authorship from a single email message
git mailsplitSimple UNIX mbox splitter program
git read-treeRead tree information into the index
git write-treeCreate a tree object from the current index
git update-indexRegister file contents in the working directory to index
git update-refUpdate the object name stored in a ref safely
git symbolic-refRead, modify, and delete symbolic refs
git pack-refsPack all refs into a single file
git prune-packedRemove extra objects already in pack files
git rerereReuse recorded resolution of conflicted merges
git check-attrDisplay gitattributes information
git check-ignoreDetermine whether a path is ignored by .gitignore
git fast-importBackend for fast Git data importers
git fast-exportGit data exporter for fast importers