Porcelain vs Plumbing
| Category | Porcelain Commands | Plumbing Commands |
|---|---|---|
| Level | High-level (user-friendly) | Low-level (internal, script-friendly) |
| Audience | End users | Tools, scripts, Git internals |
| Output | Readable, formatted | Raw, structured (for parsing) |
| Stability | Stable, designed for daily use | May change, not always user-friendly |
Tip: Porcelain = Pretty (what users interact with). Plumbing = Pipes (what Git is built on).
Porcelain Commands
44 Main Commands
| # | Command | Description |
|---|---|---|
| 1 | git add | Add file contents to the index |
| 2 | git am | Apply a series of patches from a mailbox |
| 3 | git archive | Create an archive of files from a named tree |
| 4 | git bisect | Use binary search to find the commit that introduced a bug |
| 5 | git branch | List, create, or delete branches |
| 6 | git bundle | Move objects and refs by archive |
| 7 | git checkout | Switch branches or restore working tree files |
| 8 | git cherry-pick | Apply the changes from a specific commit |
| 9 | git citool | Graphical alternative to git commit |
| 10 | git clean | Remove untracked files from the working tree |
| 11 | git clone | Clone a repository into a new directory |
| 12 | git commit | Record changes to the repository |
| 13 | git describe | Describe a commit using the most recent tag |
| 14 | git diff | Show changes between commits, working tree, etc. |
| 15 | git fetch | Download objects and refs from another repository |
| 16 | git format-patch | Prepare patches for e-mail submission |
| 17 | git gc | Optimize the local repository |
| 18 | git grep | Search for patterns in files tracked by Git |
| 19 | git gui | Launch Git's graphical interface |
| 20 | git init | Create an empty Git repository |
| 21 | git log | Show commit logs |
| 22 | git merge | Join two or more development histories |
| 23 | git mv | Move or rename a file |
| 24 | git notes | Add or inspect object notes |
| 25 | git pull | Fetch from and integrate with another repository |
| 26 | git push | Update remote refs and objects |
| 27 | git rebase | Reapply commits on top of another base tip |
| 28 | git reflog | Show history of HEAD or other references |
| 29 | git remote | Manage set of tracked repositories |
| 30 | git reset | Reset current HEAD |
| 31 | git restore | Restore working tree files |
| 32 | git revert | Create a new commit to undo previous commits |
| 33 | git rm | Remove files from the working tree and index |
| 34 | git shortlog | Summarize git log output |
| 35 | git show | Show various types of objects |
| 36 | git sparse-checkout | Manage sparse-checkout of the working directory |
| 37 | git stash | Stash the current state of the working directory |
| 38 | git status | Show the working tree status |
| 39 | git submodule | Initialize, update, or inspect submodules |
| 40 | git switch | Switch branches |
| 41 | git tag | Create, list, delete, or verify tags |
| 42 | git worktree | Manage multiple working trees |
| 43 | git config | Get and set repository or global options |
| 44 | git help | Get help for a git command |
11 Manipulators
| # | Command | Description |
|---|---|---|
| 1 | git commit | Record changes to the repository |
| 2 | git revert | Revert a previous commit by creating a new commit |
| 3 | git reset | Reset current HEAD and optionally index/working tree |
| 4 | git merge | Merge another branch into the current branch |
| 5 | git rebase | Reapply commits on top of another base tip |
| 6 | git cherry-pick | Apply changes introduced by existing commits |
| 7 | git stash | Temporarily save changes not ready to commit |
| 8 | git apply | Apply a patch to files and/or the index |
| 9 | git config | Set repository or global options |
| 10 | git reflog | Manage the reflog (can be used to recover commits) |
| 11 | git replace | Create, list, delete object replacement refs |
17 Interrogators
| # | Command | Description |
|---|---|---|
| 1 | git blame | Show who last modified each line of a file |
| 2 | git diff | Show changes between commits, working directory |
| 3 | git log | Show the commit history |
| 4 | git show | Show information about a commit or object |
| 5 | git reflog | Show history of changes to references like HEAD |
| 6 | git status | Show the working tree and staging area status |
| 7 | git shortlog | Summarize git log by author |
| 8 | git describe | Describe a commit using the nearest tag |
| 9 | git grep | Search through tracked files for a pattern |
| 10 | git config | View Git configuration values |
| 11 | git remote | View remote connections |
| 12 | git branch | List branches |
| 13 | git tag | List tags |
| 14 | git rev-parse | Convert human-readable refs to SHA-1 hashes |
| 15 | git cat-file | View object contents |
| 16 | git ls-files | Show files in the index (staging area) |
| 17 | git ls-tree | List contents of a tree object |
10 Interactors
| # | Command | Description |
|---|---|---|
| 1 | git clone | Clone a remote repository into a new local directory |
| 2 | git remote | Manage and interact with remote repositories |
| 3 | git fetch | Download commits, refs, and objects from a remote repository |
| 4 | git submodule | Initialize, update, or sync submodules |
| 5 | git request-pull | Generate a summary of changes for a pull request via email |
| 6 | git archive | Create an archive (tar/zip) of files from the repository |
| 7 | git bundle | Create or fetch from a self-contained bundle of Git objects |
| 8 | git send-email | Send patches as emails |
| 9 | git p4 | Import from and submit to Perforce repositories |
| 10 | git svn | Bidirectional operation between Subversion and Git |
Plumbing Commands
10 Manipulators
| Command | Description |
|---|---|
git hash-object | Compute object ID and optionally create a blob from a file |
git update-index | Register file contents in the working directory to the index |
git write-tree | Create a tree object from the current index |
git commit-tree | Create a new commit object |
git update-ref | Update the object name stored in a ref safely |
git symbolic-ref | Read, modify, and delete symbolic refs |
git mktree | Build a tree object from stdin |
git read-tree | Read tree information into the index |
git checkout-index | Copy files from the index to the working directory |
git prune | Remove unreachable objects from the object database |
21 Interrogators
| Command | Description |
|---|---|
git cat-file | Provide content, type, or size information for repository objects |
git check-ignore | Determine whether a path is ignored by .gitignore |
git count-objects | Count unpacked objects and display repository statistics |
git diff-files | Compare files in the working directory and the index |
git diff-index | Compare content and mode of blobs between the index and a tree |
git diff-tree | Show differences between two tree objects |
git for-each-ref | Output information on each ref |
git ls-files | Show information about files in the index and the working tree |
git ls-tree | List the contents of a tree object |
git merge-base | Find common ancestors between two commits |
git name-rev | Find symbolic names for given revisions |
git rev-list | List commit objects in reverse chronological order |
git rev-parse | Parse revision (branch, tag, etc.) identifiers |
git show-ref | List references in a local repository |
git verify-pack | Validate packed Git archive files |
git show-index | Show packed archive index |
git fsck | Verify the connectivity and validity of objects in the database |
git describe | Describe a commit using the nearest tag |
git log | Show commit logs |
git blame | Show what revision and author last modified each line of a file |
git shortlog | Summarize git log output |
5 Syncing Commands
| Command | Description |
|---|---|
git fetch-pack | Receive a packfile from a remote repository |
git send-pack | Push objects over Git protocol to another repository |
git receive-pack | Receive what is pushed into the repository |
git upload-pack | Send objects packed back to git-fetch-pack |
git pack-objects | Create a packed archive of objects |
18 Internal Helpers
| Command | Description |
|---|---|
git unpack-objects | Unpack objects from a packed archive |
git index-pack | Build pack index file for an existing packed archive |
git unpack-file | Create a temporary file with the contents of a blob |
git apply | Apply a patch to files and/or the index |
git mailinfo | Extract patch and authorship from a single email message |
git mailsplit | Simple UNIX mbox splitter program |
git read-tree | Read tree information into the index |
git write-tree | Create a tree object from the current index |
git update-index | Register file contents in the working directory to index |
git update-ref | Update the object name stored in a ref safely |
git symbolic-ref | Read, modify, and delete symbolic refs |
git pack-refs | Pack all refs into a single file |
git prune-packed | Remove extra objects already in pack files |
git rerere | Reuse recorded resolution of conflicted merges |
git check-attr | Display gitattributes information |
git check-ignore | Determine whether a path is ignored by .gitignore |
git fast-import | Backend for fast Git data importers |
git fast-export | Git data exporter for fast importers |