How To Clone A GIT Repository-DecodingDevOps

How To Clone A GIT Repository-DecodingDevOps

Git Clone

Git clone is nothing but copying your git remote repository into local computer. In the following steps i will show you how to clone a git repository in step by step.

Git Clone Remote Repository

Open your Linux terminal or windows git bash, clone your git hub or bit-bucket repository by using below git clone command.

git clone <clone url>

How To Get Clone URL

go your git-hub account or bit-bucket account you can see the right side clone or download option. click on that you can see the link, This is the cloning url. copy that link. this procedure same in git-hub and bit-bucket so go to bit-bucket and get your cloning url.

git clone

in my case my cloning url is https://github.com/decodingdevops/decodingdevops.git

git clone https://github.com/decodingdevops/decodingdevops.git

When you hit enter, if it is a public(free) repository it will not ask you any username or password. but if it is a private(paid) repository it will ask your username and password enter the values.

You can see in the image I cloned decodingdevops repository.

git clone remote repository command

Whenever you cloned your repository you will get repository as a directory(folder)

how to git clone

You can see with ls command ls command will list the all files .now I cloned my decodingdevops repository. I got decodingdevops repository as a directory(folder). so enter into repository by using cd command.

cd

cd decodingdevops

now see the files in your repository by ls command

how to git clone remote repository

ls  will list all the files in current directory(folder).you can notice that after entering into repository you can see master. That means you are in master branch. Now you can work in master branch.

Here no need to use git init command because already git has been initialized.

Whenever you cloned your repository git will initialized default with cloning.

ls –la command will show you all files plus hidden files.

git clone command

When you enter ls –la command you can see .git folder that means already your git has been initialized.

  • how to git clone
  • git clone remote repository
  • how to git clone a repository
  • git clone repository
  • git clone command

Leave a Reply

Your email address will not be published. Required fields are marked *