Git clone repository to your computer

by Daniel Pham
Published: Updated:

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.

Recommended Reading: How to install GIT version control system?

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 a 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://[email protected]': 
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.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.