GIT CLONE


Guest2022/11/06 18:08
Follow
GIT CLONE

What's git clone


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. In other words, the existing repository is located on a remote server often from a github, bitbucker... The remote url is referred to as origin


Git clone usage


Git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location. The original repository can be located on the local filesystem or on remote machine accessible supported protocols. The git clone command copies an existing Git repository. Cloning automatically creates a remote connection called "origin" pointing back to the original repository. This makes it very easy to interact with a central repository.


Git clone 'the url repository'


Git clone branch

If you are trying to clone a specific branch without cloning the whole repository, there a way to do that.

The -branch argument lets you specify a specific branch to clone instead of the branch the remote HEAD is pointing to, usually the main branch. In addition you can pass a tag instead of branch for the same effect.


Git clone --branch


Step by step on how to clone a repository with example


-Create a folder and launch your terminal.


$ cd C:/Users/user/mkdir project


- Cloning a remote repository


$ git clone https://github.com/alamadrid01/portfolio.git



- Open the file (I will be using Visual studio code)


$ code . -n


Learn more on link


Share - GIT CLONE

Follow Guest to stay updated on their latest posts!

Follow

0 comments

Be the first to comment!

This post is waiting for your feedback.
Share your thoughts and join the conversation.