← homeProgramming (Програмування)

How to clone a GitHub repository?

How to clone a GitHub repository? Use git clone or GitHub Desktop.

This content has been automatically translated from Ukrainian.
To clone a repository from GitHub, you will need Git installed on your computer.
1. Open the web page of the repository on GitHub.
2. Click on the "Code" button on the repository's web page.
3. Select the first tab "Local"
github clone code button.png
4. Copy the repository URL. There are options for HTTPS, SSH, and GitHub CLI. We need HTTPS
5. Open the command prompt (Windows) or terminal (Mac) on your computer.
6. Navigate to the directory (in the terminal, use the cd command for navigation) where you want to save the cloned repository.
7. Type the command `git clone`, then paste the copied repository URL. For example:
   git clone https://github.com/username/repository.git
Replace `username/repository` with the username and repository name you want to clone.
8. Press Enter to run the command. Git will start downloading the contents of the repository to your computer.
That's it! The GitHub repository is now cloned to your computer, and you can work with its contents locally.
Cloning a repository using GitHub Desktop
There are a few more options for how to clone a repository from GitHub. For example, I use GitHub Desktop as a GUI (graphical user interface) for git.
As you can understand from the name, this program is developed by the GitHub team. So we can see the "Open with GitHub Desktop" button, clicking on which will open (you need to install and set up this program on your computer first) this application.
github desktop.png
The interface is quite intuitive. We choose where to clone the repository, click Clone.
I usually recommend GitHub Desktop to people who know what Git is but have never worked with it (but should). I believe this is the minimal foundation to start learning Git more deeply.

🔥 More posts

All posts
Programming (Програмування)May 23, '23 06:57

What is debugging?

What is debugging?

Programming (Програмування)Jun 2, '23 12:53

What does super do in Ruby?

What does super do in Ruby? An example of using super in Ruby methods.