Package git-core-doc

Documentation files for git-core

https://git-scm.com/

Documentation files for git-core package including man pages.

General Commands (Section 1)
git
Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to...
git-add
This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit. It typically adds the...
git-annotate
Annotates each line in the given file with information from the commit which introduced the line. Optionally annotates from a given revision. The only...
git-apply
Reads the supplied diff output (i.e. "a patch") and applies it to files. When running from a subdirectory in a repository, patched paths outside the directory...
git-archive
Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output. If <prefix> is specified...
git-bisect
Use binary search to find the commit that introduced a bug
git-blame
Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision...
git-branch
If --list is given, or if there are no non-option arguments, existing branches are listed; the current branch will be highlighted with an asterisk. Option -r...
git-bundle
Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly...
git-cat-file
In its first form, the command provides the content or the type of an object in the repository. The type is required unless -t or -p is used to find the object...
git-check-attr
For every pathname, this command will list if each attribute is unspecified, set, or unset as a gitattribute on that pathname.
git-check-ignore
For each pathname given via the command-line or from a file via --stdin, check whether the file is excluded by .gitignore (or other input files to the exclude...
git-check-mailmap
For each “Name <user@host>” or “<user@host>” from the command-line or standard input (when using --stdin), look up the person’s canonical name and email address...
git-checkout
Updates files in the working tree to match the version in the index or the specified tree. If no paths are given, git checkout will also update HEAD to set the...
git-checkout-index
Will copy all files listed from the index to the working directory (not overwriting existing files).
git-check-ref-format
Checks if a given refname is acceptable, and exits with a non-zero status if it is not. A reference is used in Git to specify branches and tags. A branch head...
git-cherry
Determine whether there are commits in <head>..<upstream> that are equivalent to those in the range <limit>..<head>. The equivalence test is based on the diff...
git-cherry-pick
Given one or more existing commits, apply the change each one introduces, recording a new commit for each. This requires your working tree to be clean (no...
git-clean
Cleans the working tree by recursively removing files that are not under version control, starting from the current directory. Normally, only files unknown to...
git-clone
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -r), and...
git-column
This command formats its input into multiple columns.
git-commit
Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
git-commit-tree
This is usually not what an end user wants to run directly. See git-commit(1) instead. Creates a new commit object based on the provided tree object and emits...
git-config
You can query/set/replace/unset options with this command. The name is actually the section and the key separated by a dot, and the value will be escaped...
git-count-objects
This counts the number of unpacked object files and disk space consumed by them, to help you decide when it is a good time to repack.
git-credential
Git has an internal interface for storing and retrieving credentials from system-specific helpers, as well as prompting the user for usernames and passwords...
git-credential-cache
This command caches credentials in memory for use by future Git programs. The stored credentials never touch the disk, and are forgotten after a configurable...
git-credential-store
Helper to store credentials on disk
git-describe
The command finds the most recent tag that is reachable from a commit. If the tag points to the commit, then only the tag is shown. Otherwise, it suffixes the...
git-diff
Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, changes between two blob...
git-diff-files
Compares the files in the working tree and the index. When paths are specified, compares only those named paths. Otherwise all entries in the index are...
git-diff-index
Compares the content and mode of the blobs found in a tree object with the corresponding tracked files in the working tree, or with the corresponding paths in...
git-diff-tree
Compares the content and mode of the blobs found via two tree objects. If there is only one <tree-ish> given, the commit is compared with its parents (see...
git-fast-export
This program dumps the given revisions in a form suitable to be piped into git fast-import. You can use it as a human-readable bundle replacement (see...
git-fast-import
This program is usually not what the end user wants to run directly. Most end users want to use one of the existing frontend programs, which parses a specific...
git-fetch
Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories...
git-fetch-pack
Usually you would want to use git fetch, which is a higher level wrapper of this command, instead. Invokes git-upload-pack on a possibly remote repository and...
git-filter-branch
Lets you rewrite Git revision history by rewriting the branches mentioned in the <rev-list options>, applying custom filters on each revision. Those filters can...
git-fmt-merge-msg
Takes the list of merged objects on stdin and produces a suitable commit message to be used for the merge commit, usually to be passed as the <merge-message>...
git-for-each-ref
Iterate over all refs that match <pattern> and show them according to the given <format>, after sorting them according to the given set of <key>. If <count> is...
git-format-patch
Prepare each commit with its patch in one file per commit, formatted to resemble UNIX mailbox format. The output of this command is convenient for e-mail...
git-fsck
Verifies the connectivity and validity of the objects in the database.
git-fsck-objects
This is a synonym for git-fsck(1). Please refer to the documentation of that command.
git-gc
Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance) and...
git-get-tar-commit-id
Read a tar archive created by git archive from the standard input and extract the commit ID stored in it. It reads only the first 1024 bytes of input, thus its...
git-grep
Look for specified patterns in the tracked files in the work tree, blobs registered in the index file, or blobs in given tree objects. Patterns are lists of one...
git-hash-object
Computes the object ID value for an object with specified type with the contents of the named file (which can be outside of the work tree), and optionally...
git-help
With no options and no COMMAND or GUIDE given, the synopsis of the git command and a list of the most commonly used Git commands are printed on the standard...
git-http-backend
A simple CGI program to serve the contents of a Git repository to Git clients accessing the repository over http:// and https:// protocols. The program supports...
git-http-fetch
Downloads a remote Git repository via HTTP. NOTE: use of this command without -a is deprecated. The -a behaviour will become the default in a future release.
git-http-push
Sends missing objects to remote repository, and updates the remote branch. NOTE: This command is temporarily disabled if your libcurl is older than 7.16, as the...
git-imap-send
This command uploads a mailbox generated with git format-patch into an IMAP drafts folder. This allows patches to be sent as other email is when using mail...
git-index-pack
Reads a packed archive (.pack) from the specified file, and builds a pack index file (.idx) for it. The packed archive together with the pack index can then be...
git-init
This command creates an empty Git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files. An initial...
git-init-db
This is a synonym for git-init(1). Please refer to the documentation of that command.
git-interpret-trailers
Help adding trailers lines, that look similar to RFC 822 e-mail headers, at the end of the otherwise free-form part of a commit message. This command reads some...
git-log
Shows the commit logs. The command takes options applicable to the git rev-list command to control what is shown and how, and options applicable to the git...
git-ls-files
This merges the file listing in the directory cache index with the actual working directory list, and shows different combinations of the two.
git-ls-remote
Displays references available in a remote repository along with the associated commit IDs.
git-ls-tree
Lists the contents of a given tree object, like what "/bin/ls -a" does in the current working directory.
git-mailinfo
Reads a single e-mail message from the standard input, and writes the commit log message in <msg> file, and the patches in <patch> file. The author name, e-mail...
git-mailsplit
Splits a mbox file or a Maildir into a list of files: "0001" "0002" .. in the specified directory so you can process them further from there.
git-merge
Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch. This command is used by...
git-merge-base
git merge-base finds best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is better than another common ancestor if the...
git-merge-file
git merge-file incorporates all changes that lead from the <base-file> to <other-file> into <current-file>. The result ordinarily goes into <current-file>. git...
git-merge-index
This looks up the <file>(s) in the index and, if there are any merge entries, passes the SHA-1 hash for those files as arguments 1, 2, 3 (empty argument if no...
git-merge-one-file
This is the standard helper program to use with git merge-index to resolve a merge after the trivial merge done with git read-tree -m.
git-mergetool
Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are...
git-mergetool--lib
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing...
git-merge-tree
Reads three tree-ish, and output trivial merge results and conflicting stages to the standard output. This is similar to what three-way git read-tree -m does...
git-mktag
Reads a tag contents on standard input and creates a tag object that can also be used to sign other objects. The output is the new tag’s <object> identifier.
git-mktree
Reads standard input in non-recursive ls-tree output format, and creates a tree object. The order of the tree entries is normalised by mktree so pre-sorting the...
git-mv
Move or rename a file, directory or symlink.
git-name-rev
Finds symbolic names suitable for human digestion for revisions given in any format parsable by git rev-parse.
git-notes
Adds, removes, or reads notes attached to objects, without touching the objects themselves. By default, notes are saved to and read from refs/notes/commits, but...
git-pack-objects
Reads list of objects from the standard input, and writes a packed archive with specified base-name, or to the standard output. A packed archive is an efficient...
git-pack-redundant
This program computes which packs in your repository are redundant. The output is suitable for piping to xargs rm if you are in the root of the repository. git...
git-pack-refs
Traditionally, tips of branches and tags (collectively known as refs) were stored one file per ref in a (sub)directory under $GIT_DIR/refs directory. While many...
git-parse-remote
This script is included in various scripts to supply routines to parse files under $GIT_DIR/remotes/ and $GIT_DIR/branches/ and configuration variables that are...
git-patch-id
Read a patch from the standard input and compute the patch ID for it. A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with...
git-prune
Prune all unreachable objects from the object database
git-prune-packed
This program searches the $GIT_OBJECT_DIRECTORY for all objects that currently exist in a pack file as well as the independent object directories. All such...
git-pull
Incorporates changes from a remote repository into the current branch. In its default mode, git pull is shorthand for git fetch followed by git merge...
git-push
Updates remote refs using local refs, while sending objects necessary to complete the given refs. You can make interesting things happen to a repository every...
git-quiltimport
Applies a quilt patchset onto the current Git branch, preserving the patch boundaries, patch order, and patch descriptions present in the quilt patchset. For...
git-read-tree
Reads the tree information given by <tree-ish> into the index, but does not actually update any of the files it "caches". (see: git-checkout-index(1))...
git-rebase
If <branch> is specified, git rebase will perform an automatic git checkout <branch> before doing anything else. Otherwise it remains on the current branch. If...
git-receive-pack
Invoked by git send-pack and updates the repository with the information fed from the remote end. This command is usually not invoked directly by the end user...
git-reflog
Manage reflog information
git-remote
Manage the set of repositories ("remotes") whose branches you track.
git-remote-ext
This remote helper uses the specified <command> to connect to a remote Git server. Data written to stdin of the specified <command> is assumed to be sent to a...
git-remote-fd
This helper uses specified file descriptors to connect to a remote Git server. This is not meant for end users but for programs and scripts calling git fetch...
gitremote-helpers
Remote helper programs are normally not used directly by end users, but they are invoked by Git when it needs to interact with remote repositories Git does not...
git-remote-testgit
This command is a simple remote-helper, that is used both as a testcase for the remote-helper functionality, and as an example to show remote-helper authors one...
git-repack
This command is used to combine all objects that do not currently reside in a "pack", into a pack. It can also be used to re-organize existing packs into a...
git-replace
Adds a replace reference in refs/replace/ namespace. The name of the replace reference is the SHA-1 of the object that is replaced. The content of the replace...
git-rerere
In a workflow employing relatively long lived topic branches, the developer sometimes needs to resolve the same conflicts over and over again until the topic...
git-reset
In the first and second form, copy entries from <tree-ish> to the index. In the third form, set the current branch head (HEAD) to <commit>, optionally modifying...
git-revert
Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them. This requires your...
git-rev-list
List commits that are reachable by following the parent links from the given commit(s), but exclude commits that are reachable from the one(s) given with a ^ in...
git-rev-parse
Many Git porcelainish commands take mixture of flags (i.e. parameters that begin with a dash -) and parameters meant for the underlying git rev-list command...
git-rm
Remove files from the index, or from the working tree and the index. git rm will not remove a file from just your working directory. (There is no option to...
git-send-pack
Usually you would want to use git push, which is a higher-level wrapper of this command, instead. See git-push(1). Invokes git-receive-pack on a possibly remote...
git-shell
This is a login shell for SSH accounts to provide restricted Git access. It permits execution only of server-side Git commands implementing the pull/push...
git-sh-i18n
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing...
git-sh-i18n--envsubst
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the plumbing scripts and/or are writing new...
git-shortlog
Summarizes git log output in a format suitable for inclusion in release announcements. Each commit will be grouped by author and title. Additionally, "[PATCH]"...
git-show
Shows one or more objects (blobs, trees, tags and commits). For commits it shows the log message and textual diff. It also presents the merge commit in a...
git-show-branch
Shows the commit ancestry graph starting from the commits named with <rev>s or <globs>s (or all refs under refs/heads and/or refs/tags) semi-visually. It cannot...
git-show-index
Read the idx file for a Git packfile created with git pack-objects command from the standard input, and dump its contents. The information it outputs is subset...
git-show-ref
Displays references available in a local repository along with the associated commit IDs. Results can be filtered using a pattern and tags can be dereferenced...
git-sh-setup
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing...
git-stage
This is a synonym for git-add(1). Please refer to the documentation of that command.
git-stash
Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command...
git-status
Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index...
git-stripspace
Read text, such as commit messages, notes, tags and branch descriptions, from the standard input and clean it in the manner used by Git.
git-subtree
Subtrees allow subprojects to be included within a subdirectory of the main project, optionally including the subproject’s entire history. For example, you...
git-symbolic-ref
Given one argument, reads which branch head the given symbolic ref refers to and outputs its path, relative to the .git/ directory. Typically you would give...
git-tag
Add a tag reference in refs/tags/, unless -d/-l/-v is given to delete, list or verify tags. Unless -f is given, the named tag must not yet exist. If one of -a...
git-unpack-file
Creates a file holding the contents of the blob specified by sha1. It returns the name of the temporary file in the following format: .merge_file_XXXXX
git-unpack-objects
Read a packed archive (.pack) from the standard input, expanding the objects contained within and writing them into the repository in "loose" (one object per...
git-update-index
Modifies the index or directory cache. Each file mentioned is updated into the index and any unmerged or needs updating state is cleared. See also git-add(1)...
git-update-ref
Given two arguments, stores the <newvalue> in the <ref>, possibly dereferencing the symbolic refs. E.g. git update-ref HEAD <newvalue> updates the current...
git-update-server-info
A dumb server that does not do on-the-fly pack generations must have some auxiliary information files in $GIT_DIR/info and $GIT_OBJECT_DIRECTORY/info...
git-upload-archive
Invoked by git archive --remote and sends a generated archive to the other end over the Git protocol. This command is usually not invoked directly by the end...
git-upload-pack
Send objects packed back to git-fetch-pack
git-var
Prints a Git logical variable.
git-verify-commit
Validates the GPG signature created by git commit -S.
git-verify-pack
Reads given idx file for packed Git archive created with the git pack-objects command and verifies idx file and the corresponding pack file.
git-verify-tag
Validates the gpg signature created by git tag.
git-web--browse
This script tries, as much as possible, to display the URLs and FILEs that are passed as arguments, as HTML pages in new tabs on an already opened web browser.
git-whatchanged
Shows commit logs and diff output each commit introduces. New users are encouraged to use git-log(1) instead. The whatchanged command is essentially the same as...
git-worktree
Manage multiple working trees attached to the same repository. A git repository can support multiple working trees, allowing you to check out more than one...
git-write-tree
Creates a tree object using the current index. The name of the new tree object is printed to standard output. The index must be in a fully merged state...
File Formats (Section 5)
gitattributes
A gitattributes file is a simple text file that gives attributes to pathnames.
githooks
Hooks are programs you can place in a hooks directory to trigger actions at certain points in git’s execution. Hooks that don’t have the executable bit set are...
gitignore
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the Notes below for details...
gitmodules
The .gitmodules file, located in the top-level directory of a Git working tree, is a text file with a syntax matching the requirements of git-config(1). The...
gitrepository-layout
Git Repository Layout
Miscellanea (Section 7)
gitcli
This manual describes the convention used throughout Git CLI. Many commands take revisions (most often "commits", but sometimes "tree-ish", depending on the...
gitcore-tutorial
This tutorial explains how to use the "core" Git commands to set up and work with a Git repository. If you just need to use Git as a revision control system you...
gitcredentials
Git will sometimes need credentials from the user in order to perform operations; for example, it may need to ask for a username and password in order to access...
gitcvs-migration
Git differs from CVS in that every working tree contains a repository with a full copy of the project history, and no repository is inherently more important...
gitdiffcore
The diff commands git diff-index, git diff-files, and git diff-tree can be told to manipulate differences they find in unconventional ways before showing diff...
giteveryday
Git users can broadly be grouped into four categories for the purposes of describing here a small set of useful command for everyday Git.
gitglossary
alternate object database
gitnamespaces
Git supports dividing the refs of a single repository into multiple namespaces, each of which has its own branches, tags, and HEAD. Git can expose each...
gitrevisions
Many Git commands take revision parameters as arguments. Depending on the command, they denote a specific commit or, for commands which walk the revision graph...
gittutorial
This tutorial explains how to import a new project into Git, make changes to it, and share changes with other developers. If you are instead primarily...
gittutorial-2
You should work through gittutorial(7) before reading this tutorial. The goal of this tutorial is to introduce two fundamental pieces of Git’s architecture—the...
gitworkflows
This document attempts to write down and motivate some of the workflow elements used for git.git itself. Many ideas apply in general, though the full workflow...