The git clone --branch command is used to clone a specific branch from a remote Git repository to your local machine. By default, when you clone a repository, it clones the main branch (usually called main or master). If you want to get a copy of an existing Git repository — for example, a project you’d like to contribute to — the command you need is git clone. If you’re familiar with other VCSs such as Subversion, you’ll notice that the command is "clone" and not "checkout". This is an important distinction — instead of getting just a working copy, Git receives a full copy of nearly all data that the server has. Every version of every file for the history of the project is pulled down by ... Learn how to use the ‘git clone’ command to copy a Git repository from a remote server to your local machine. See examples of basic and advanced usage, such as cloning a specific branch, a shallow clone, a submodule, or a mirror clone. Here we'll examine the git clone command in depth. git clone is a Git command line utility which is used to target an existing repository and create a clone, or copy of the target repository.