git clone: how to download a repository

Run git clone <url>. Git downloads every file and the full history into a new folder, and remembers the source as origin so git pull and git push work right away.

Step by step

  1. Download the project:

    $ git clone https://github.com/brewco/website
  2. Go into it:

    $ cd website
  3. See its history:

    $ git log

After cloning, main is your copy of the branch and origin/main is your computer's memory of GitHub's.

Try it in the interactive sandbox →Practice “Clone the project” with a real repository and teammates, right in your browser.

Related guides