Cloning a repository means creating a copy of a repository. git clone command is used to clone a repository. It takes two arguments:
Let's say you want to clone Google Test repository, so run the following command:
$git clone https://github.com/google/googletest.git
You will find that a directory named googletest
is created. If you change into this directory and run ls -a
, you will find all the repository files. Also, you will see .git
directory that holds a copy of the repository history.
$cd googletest $ls -a . BUILD.bazel CMakeLists.txt .gitignore library.json README.md .. ci CONTRIBUTING.md googlemock LICENSE .travis.yml appveyor.yml .clang-format .git googletest platformio.ini WORKSPACE
It is important to note that when you clone a repository, two things happen:
master
branch is copied which you can check by running git branch
.$git branch * master
git remote
.$git remote origin
By default, Git assigns a name "origin" to the remote repo, and because of which you will see a remote repo named origin
in the output.