GIT Course

git clone

Go back

You can get a project from the server using this command git clone.

git clone URL

To get the URL, you can do something like this on the page of your repository

clone

  • click on the arrow
  • choose SSH (no login, if you configured ssh keys) or HTTPS (always login)
  • then copy the link, that's your URL

git clone (other uses)

You can also add a folder, to put the content directly inside a folder.

git clone URL folder

You can also pick a branch (explained later), using

git clone URL --branch name

git init

You can create a repository from existing files using git init, with URL the same as above.

git init
git remote add origin URL

git remote

You can switch to another URL using git remote, such as switching from HTTPS to SSH.

git remote set-url origin new_url