Documentation Index
Fetch the complete documentation index at: https://mintlify.com/git/git/llms.txt
Use this file to discover all available pages before exploring further.
Synopsis
Description
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository, and creates and checks out an initial branch that is forked from the cloned repository’s currently active branch.After the clone, a plain
git fetch without arguments will update all the remote-tracking branches, and a git pull without arguments will in addition merge the remote default branch into the current branch.Common Usage
Options
--depth <depth>
--depth <depth>
Create a shallow clone with a history truncated to the specified number of commits.
-b <name>, --branch <name>
-b <name>, --branch <name>
Instead of pointing the newly created HEAD to the default branch, point it to the specified branch.
--single-branch
--single-branch
Clone only the history leading to the tip of a single branch.
-o <name>, --origin <name>
-o <name>, --origin <name>
Instead of using the remote name
origin, use the specified name.--bare
--bare
Make a bare Git repository - without a working directory.
--mirror
--mirror
Set up a mirror of the source repository - implies
--bare.--recurse-submodules
--recurse-submodules
Initialize and clone submodules within the repository.
-q, --quiet
-q, --quiet
Operate quietly - suppress progress reporting.
