Git clone repository to your computer


SystemMen - Git clone repository to your computer. After you have created the repository, how do you work with it now?

This article, I will guide you to use Git to clone the repository to your computer.

You need to install Git on your computer to use it.

Get the clone URL of the repository

Now, please login to Gitlab, click to select your repository. For example, I select a repository named systemmen.com.

Then, press the Clone button in the right corner of the screen. It will display 2 URLs for you to choose.

git-clone-repository-to-your-computer Git clone repository to your computer
Git clone a repository to your computer.
  1. Clone with SSH: you clone via SSH protocol.
  2. Clone with HTTPS: that you clone through HTTPS protocol.

Both options are good and you can use them freely. For me, I use HTTPS.

You click the copy button to the right of the URL.

Git clone repository to your computer

I am using Linux, so I just need to open up the terminal and start using.

If you are using Windows, open the Git Bash program.

You type the command below to clone the repository to your computer, please replace your corresponding URL.

git clone https://gitlab.com/Danny_Pham/systemmen.com.git

It’s look like this.

danie@linuxmint ~/Desktop/down/gitlab $ git clone https://gitlab.com/Danny_Pham/systemmen.com.git
Cloning into 'systemmen.com'…
Username for 'https://gitlab.com': Danny_Pham
Password for 'https://Danny_Pham@gitlab.com':
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity… done.

Because I’m putting the repository in Private mode, when clone, it will ask me to enter the Gitlab account username and password.

Now, when I list the repository that I cloned to the computer, you will see the README file in it.

danie@linuxmint ~/Desktop/down/gitlab $ ls
systemmen.com
danie@linuxmint ~/Desktop/down/gitlab $ cd systemmen.com/
danie@linuxmint ~/Desktop/down/gitlab/systemmen.com $ ls
README.md

Conclusion

This is the first step you use Git to work with your repository. Perform clone it to the computer. If you notice, the source clone directory under the computer and on Gitlab is exactly the same.

«« »»