How to download from github windows

Скачать отдельные файлы из GitHub

Я думаю, большинство из вас, разработчики, используют любой VCS, и я надеюсь, что некоторые из вас используют Git. У вас есть какой-либо совет или трюк, как получить URL-адрес загрузки для одного файла в репозитории?

Я не хочу URL для отображения raw-файла; в случае двоичных файлов это ни для чего.

можно ли вообще использовать GitHub в качестве » скачать сервер»?

Если мы решим перейти на код Google, здесь представлена упомянутая функциональность?

или есть ли бесплатный хостинг и VCS для проектов с открытым кодом?

26 ответов:

Git не поддерживает загрузку частей репозитория. Вы должны скачать все. Но вы должны быть в состоянии сделать это с GitHub.

при просмотре файла он имеет ссылку на» сырую » версию. Элемент URL построена так

заполнив пробелы в URL, вы можете использовать Wget или cURL (С -L опция, см. ниже) или что угодно, чтобы загрузить один файл. Опять же, вы не получите ни одного из приятные особенности контроля версий используется Git с этим.

обновление: я заметил, что вы упомянули, что это не работает для двоичных файлов. Вероятно, вы не должны использовать двоичные файлы в своем репозитории Git, но GitHub имеет раздел загрузки для каждого репозитория, который вы можете использовать для загрузки файлов. Если вам нужно более одного двоичного файла, вы можете использовать a .сжатый файл. URL-адрес для загрузки загружаемого файла составляет:

обратите внимание, что URL-адреса, приведенные выше, из ссылок на github.com , будет перенаправлять к raw.githubusercontent.com . Вы не должны напрямую использовать URL-адрес, указанный этим перенаправлением HTTP 302, потому что, per RFC 2616: «поскольку перенаправление может быть изменено время от времени, клиент должен продолжать использовать запрос-URI для будущих запросов.»

  1. перейдите к файлу, который вы хотите скачать.
  2. щелкните его, чтобы просмотреть содержимое в пользовательском интерфейсе GitHub.
  3. в правом верхнем углу щелкните правой кнопкой мыши the .
  4. Сохранить как.

вы можете использовать API V3, чтобы получить raw-файл, как это (вам понадобится маркер OAuth):

curl -H ‘Authorization: token INSERTACCESSTOKENHERE’ -H ‘Accept: application/vnd.github.v3.raw’ -O -L https://api.github.com/repos/owner/repo/contents/path

Читайте также:  Windows 10 как эмулировать диск

все это должно идти в одну строку. Элемент -O опция сохраняет файл в текущем каталоге. Вы можете использовать -o filename , чтобы указать другое имя файла.

How do I download a particular file from GitHub?

I only need one particular file from a project published on GitHub so it makes little sense to download the whole project. But I just can’t find the download button.

5 Answers 5

If you’re viewing the contents of the file itself there should be a «Raw» button.

  • Right-click on that and select the «Save content as. » (or similar depending on your browser)
  • Click through to see the contents dumped onto the screen and save from there

In the list of files, every filename is a link. A simple right-click and «Save link as. » (or equivalent for your browser) will allow you to download a single file.

This breaks down with HTML files, however. You’ll need to use the «Raw» button on the file page as Eight Days of Malaise’s answer describes. I’m using Google Chrome. You may have a different experience on a different browser.

Check out RawGit which is a free service to serve files directly from Github with proper Content-type headers.

If you are using the Chromium browser, just hold down the ALT key and left click on the file to download it.

(Doesn’t work with Mozilla Firefox, haven’t tested other browsers.)

You can try github-files-fetcher, it is a command line tool which downloads a single folder or file from a GitHub repo.

Think a real scenario: you were visiting the following webpage page and wanna download the async subdirectory alone.

How to download a folder from github?

I wished to download the mysite folder from this link: https://github.com/username/repository/master/

11 Answers 11

There is a button Download ZIP . If you want to do a sparse checkout there are many solutions on the site. For example here.

You can download a file/folder from github

Simply use: svn export /trunk/

Ex: svn export https://github.com/lodash/lodash/trunk/docs

Note: You may first list the contents of the folder in terminal using svn ls /trunk/folder

(yes, that’s svn here. apparently in 2016 you still need svn to simply download some github files)

Читайте также:  Installing sass on windows

You can use Github Contents API to get an archive link and tar to retrieve a specified folder.

Command line:

curl https://codeload.github.com/[owner]/[repo]/tar.gz/master | \ tar -xz —strip=2 [repo]-master/[folder_path]

For example,
if you want to download examples/with-apollo/ folder from zeit/next.js, you can type this:

Use GitZip online tool. It allows to download a sub-directory of a github repository as a zip file. No git commands needed!

How to download a specific folder from a GitHub repo

Here a proper solution according to this post:

Create a directory

Set up a git repo

Configure your git-repo to download only specific directories

Fastest way to download a GitHub project

I need to download the source code of the project Spring data graph example into my box. It has public read-only access. Is there is an extremely fast way of downloading this code?

I have no idea of working on GitHub/committing code and most tutorials out there on the web seems to assume that «I would want to setup a project in GitHub» and inundate me with 15-20 step processes. To me, if a source repository is available for the public, it should take less than 10 seconds to have that code in my filesystem.

Tutorials that provide me with 15-20 step processes:

I need something very very very simple. Just pull the source code, and I am more interested in seeing the source code and not learn GitHub.

Are there any fast pointers/tutorials? (I have a GitHub account.)

8 Answers 8

When you are on a project page, you can press the ‘Download ZIP’ button which is located under the «Clone or Download» drop down:

This allows you to download the most recent version of the code as a zip archive.

If you aren’t seeing that button, it is likely because you aren’t on the main project page. To get there, click on the left-most tab labeled «<> Code».

To me if a source repository is available for public it should take less than 10 seconds to have that code in my filesystem.

And of course, if you want to use Git (which GitHub is all about), then what you do to get the code onto your system is called «cloning the repository».

It’s a single Git invocation on the command line, and it will give you the code just as seen when you browse the repository on the web (when getting a ZIP archive, you will need to unpack it and so on, it’s not always directly browsable). For the repository you mention, you would do:

Читайте также:  Zeplin для windows что это

The git: -type URL is the one from the page you linked to. On my system just now, running the above command took 3.2 seconds. Of course, unlike ZIP, the time to clone a repository will increase when the repository’s history grows. There are options for that, but let’s keep this simple.

I’m just saying: You sound very frustrated when a large part of the problem is your reluctance to actually use Git.

Installing GitHub Desktop

You can install GitHub Desktop on supported Windows or macOS operating systems.

In this article

About GitHub Desktop installation

You can install GitHub Desktop on supported operating systems. If you have an account on GitHub or GitHub Enterprise, you can connect your account to GitHub Desktop. For more information about creating an account, see «Signing up for a new GitHub account» or contact your GitHub Enterprise site administrator.

If you are a network administrator, you can deploy GitHub Desktop to computers running Windows on an Active Directory-managed network by using the Windows Installer package file ( .msi ) with Group Policy or another remote installation system.

The Windows Installer package extracts the standalone installer ( .exe ) and configures Windows to install GitHub Desktop the next time a user signs in to their workstation. Users must have permissions to install GitHub Desktop in their user directory.

If a user runs the Windows Installer package for GitHub Desktop directly, to complete the installation, the user must sign out of their workstation and then sign back in.

Downloading and installing GitHub Desktop

You can install GitHub Desktop on macOS 10.10 or later.

You can install GitHub Desktop on Windows 7 64-bit or later.

Warning: You must have a 64-bit operating system to run GitHub Desktop.

  1. Visit the download page for GitHub Desktop.
  2. Click Download for Windows.

Help us make these docs great!

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

Оцените статью