git clone
git clone
command is used to create a copy of an existing Git repository from a remote server (like GitHub, GitLab) to your local machine.
git clone
:
git clone
? git clone
command:
git clone <remote-repo-URL>
git clone https://github.com/SmartProgrammingCoders/GitDemo.git
https://github.com/SmartProgrammingCoders/GitDemo.git
to our local machine using the git clone
command.
git clone
? git clone <repository-url>
git clone https://github.com/SmartProgrammingCoders/GitDemo.git
git clone "C:\Users\Deepak Panwar\Desktop\gitdemo"
git clone <repository-url> <custom-directory-name>
git clone https://github.com/SmartProgrammingCoders/GitDemo.git my-local-repo
git clone <repository-url> <custom-directory-name>
git clone https://github.com/username/repo-name.git my-local-repo
git clone
fetches the default branch (usually main
or master
).
git clone -b <branch-name> <repository-url>
git clone -b develop https://github.com/username/repo-name.git
git clone --depth <number> <repository-url>
git clone --depth 1 https://github.com/username/repo-name.git
(clones only the latest commit)
git clone git@github.com:username/repo-name.git
Your feedback helps us grow! If there's anything we can fix or improve, please let us know.
Weโre here to make our tutorials better based on your thoughts and suggestions.