Where knowledge empowers you to understand your world

How To Clone A Git Repository

You can clone a Git repository easily using the ‘git clone’ command.

How To Clone A Git Repository From GitHub

You can clone a GitHub repository by going to the repository’s page on GitHub and clicking the green ‘Code’ button on the right side of the screen, which will bring up a small window containing a link to its ‘.git’ file as shown below. This is the file you need to get started with cloning.

Copy the URL provided in that little window and then type:

git clone -R https://github.com/signalapp/Signal-Desktop.git

If you get the following error: ‘bash: git: command not found’, it’s because you need to install Git. On Debian the command to install Git is:

sudo apt install git

Cloning should produce output like this:

Cloning into 'repositoryname'...
remote: Enumerating objects: 245912, done.
remote: Total 245912 (delta 0), reused 0 (delta 0), pack-reused 245912
Receiving objects: 100% (245912/245912), 225.12 MiB | 6.66 MiB/s, done.
Resolving deltas: 100% (172750/172750), done.

After you have cloned the repository, you should now enter the directory, which enables you to run the checkout, branch, configure, make, and other commands you are likely to need.

Further Reading

How To Delete A Local Branch In Git

How To Clone All Remote Branches In Git