Как скачать репозиторий с гитхаба

от admin

Cloning a repository

When you create a repository on GitHub.com, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.

About cloning a repository

You can clone a repository from GitHub.com to your local computer to make it easier to fix merge conflicts, add or remove files, and push larger commits. When you clone a repository, you copy the repository from GitHub.com to your local machine.

Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project. You can push your changes to the remote repository on GitHub.com, or pull other people’s changes from GitHub.com. For more information, see «Using Git».

You can clone your existing repository or clone another person’s existing repository to contribute to a project.

Cloning a repository

On GitHub.com, navigate to the main page of the repository.

Above the list of files, click

Code.

Copy the URL for the repository.

    To clone the repository using HTTPS, under «HTTPS», click

Open Terminal Terminal Git Bash .

Change the current working directory to the location where you want the cloned directory.

Type git clone , and then paste the URL you copied earlier.

Press Enter to create your local clone.

To learn more about GitHub CLI, see «About GitHub CLI.»

To clone a repository locally, use the repo clone subcommand. Replace the repository parameter with the repository name. For example, octo-org/octo-repo , monalisa/octo-repo , or octo-repo . If the OWNER/ portion of the OWNER/REPO repository argument is omitted, it defaults to the name of the authenticating user.

You can also use the GitHub URL to clone a repository.

  1. On GitHub.com, navigate to the main page of the repository.
  2. Above the list of files, click

Code.

Open with GitHub Desktop to clone and open the repository with GitHub Desktop.

"Open with GitHub Desktop" button

Cloning an empty repository

An empty repository contains no files. It’s often made if you don’t initialize the repository with a README when creating it.

On GitHub.com, navigate to the main page of the repository.

To clone your repository using the command line using HTTPS, under «Quick setup», click

. To clone the repository using an SSH key, including a certificate issued by your organization’s SSH certificate authority, click SSH, then click

Alternatively, to clone your repository in Desktop, click

Set up in Desktop and follow the prompts to complete the clone.

Open Terminal Terminal Git Bash .

Change the current working directory to the location where you want the cloned directory.

Читать:
Почему ворд не показывает ошибки в тексте

Type git clone , and then paste the URL you copied earlier.

Press Enter to create your local clone.

Troubleshooting cloning errors

When cloning a repository it’s possible that you might encounter some errors.

If you’re unable to clone a repository, check that:

  • You can connect using HTTPS. For more information, see «Troubleshooting cloning errors.»
  • You have permission to access the repository you want to clone. For more information, see «Troubleshooting cloning errors.»
  • The default branch you want to clone still exists. For more information, see «Troubleshooting cloning errors.»

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

How to Download From GitHub: A Beginner’s Guide

Jamie Juviler

GitHub is one of the largest developer resources, and an absolute must-know for aspiring web developers to explore and share projects online.

person using a computer do download from github

If you’re just starting out with git and GitHub, taking open-source code from GitHub to experiment with or add to your own projects is one great way to learn. To do that, you’ll need to learn the basics: getting a file from GitHub onto your computer.

How to download source in ZIP format from GitHub?

Now I’m not that CVS, SVN, etc. dude. When I open that in the browser it tells me that I did something wrong. So I bet I need some hacker-style tool? Some client?

(I mean. why not just provide a ZIP file? Isn’t the world complex enough?)

Peter Mortensen's user avatar

15 Answers 15

What happens when the repository owner has not prepared a zip file, and you just want a download to use yourself? There is an answer and you don’t need to go though that horrid process to download software, install and register keys and whatnot on GitHub, etc.!

To simply download a repository as a zip file: add the extra path ‘/zipball/master/’ to the end of the repository URL and voila, it gives you a zip file of the whole lot.

It then gives you a zip file to download.

halfer's user avatar

To clone that repository via a URL like that: yes, you do need a client, and that client is Git. That will let you make changes, your own branches, merge back in sync with other developers, maintain your own source that you can easily keep up to date without downloading the whole thing each time and writing over your own changes etc. A ZIP file won’t let you do that.

It is mostly meant for people who want to develop the source rather than people who just want to get the source one off and not make changes.

Похожие статьи