How to download folder from github
How to download folder from github
Github download folder as zip
How can I provide visitors of my Github repositories a link to download the builds folder of my repository as zip file? The folder contains a executable, shaders and textures needed by the application.
Of course I could manually build a zip file of that directory and add that to the repository. But that results in redundant files, bigger size and unnecessary work for each commit.
So is there a way to zip and download a specific folder and its content of a git repository on Github? Maybe Github has the ability already?
2 Answers 2
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Update July 2013:
As I mention in «Releasing a build artifact on github», you can define a release and upload binaries attached to that release!
Original answer (January 2013)
No, you cannot do it with GitHub alone.
And GitHub recently got rid of its upload feature, which would have allowed you to uplad a binary for your user to get (without making your git repo grow in size).
So you need to store said binary in another external (binary) repository (Nexus, or Amazon s3 service, or. )
GitHub Community
How can I download a specific folder or directory from a remote Git repo hosted on GitHub? I only want just that a specific folder where the files for the front-end part of the app are kept, without having the other files as I don’t really need them.
Beta Was this translation helpful? Give feedback.
100 You must be logged in to vote
If you are willing to use git to do this, you can do a sparse checkout.
We are going to start by creating an empty git repo locally, and then add the repository we want as a remote. This allows us to easily just checkout the folder we want
After that, we want to add the directory to
(this is essentially the opposite of the gitignore file).
and it should download only the folder you want.
Obviously, this requires you to use git, but it shouldn’t bee too difficult to automate if it’s something you are doing often.
Replies
If you are willing to use git to do this, you can do a sparse checkout.
We are going to start by creating an empty git repo locally, and then add the repository we want as a remote. This allows us to easily just checkout the folder we want
After that, we want to add the directory to
(this is essentially the opposite of the gitignore file).
and it should download only the folder you want.
Obviously, this requires you to use git, but it shouldn’t bee too difficult to automate if it’s something you are doing often.
Beta Was this translation helpful? Give feedback.
Marked as answer
1 You must be logged in to vote
Awesome! Thanks a lot, will definitely try this.
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
I have a specific folder from a remote Git repo that I’ve hosted on GitHub. How can I download only that one specific folder?
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
@nadiajoyce Well this question is different mine is different, I want to download a specific folder locally not on a remote Git repo I think you misunderstood my question please check it once again.I totally understand that in order to maintain forum organized you have close my question but I request you to open again since my question is different from above question.
Beta Was this translation helpful? Give feedback.
Загрузите отдельную папку или каталог из репозитория GitHub
Как я могу загрузить только определенную папку или каталог из удаленного репозитория Git, размещенного на GitHub?
Скажем, здесь находится репозиторий GitHub:
Его структура каталогов:
Я хочу загрузить только папку foo, а не клонировать весь тестовый проект.
Обновление от апреля 2021 года : есть несколько инструментов, созданных сообществом, которые могут сделать это за вас:
Примечание: если вы пытаетесь загрузить большое количество файлов, вам может потребоваться предоставить токен для этих инструментов, чтобы избежать ограничения скорости.
Вы можете не увидеть никакой активности сразу, потому что Github требуется до 30 секунд для преобразования больших репозиториев, так что наберитесь терпения.
Отказ от ответственности: я столкнулся с той же проблемой, что и задающий вопрос, и не смог найти подходящего решения. Итак, я сначала создал этот инструмент для себя, а потом открыл его для всех 🙂
Два варианта этой функции:
Вариант 1. Расширение браузера GitZip
Вариант 2: gh-страница на Github
Шаг 1. Введите URL-адрес github в поле вверху справа.
Шаг 2: Нажмите «Ввод» или «Загрузить», чтобы загрузить zip-архив напрямую, или нажмите «Поиск», чтобы просмотреть список подпапок и файлов.
Шаг 3: Нажмите кнопку «Загрузить Zip-файл» или «Получить файл», чтобы получить файлы.
В большинстве случаев он работает нормально, за исключением того, что папка содержит более 1000 файлов из-за ограничения API Github Trees. (относится к Github API # Contents )
И он также может поддерживать частные / общедоступные репозитории и обновлять лимит скорости, если у вас есть учетная запись GitHub и вы используете ссылку «получить токен» на этом сайте.
Обратите внимание на формат URL:
Перед запуском svn export рекомендуется сначала проверить содержимое каталога с помощью:
Для общего репозитория git:
git-archive создает сжатый zip- или tar-архив из репозитория git. Некоторые вещи, которые делают его особенным:
Пример создания архива docs/usage каталога из удаленного репо, к которому вы подключены с помощью ssh:
Примечание о репозиториях GitHub:
В других ответах нет ничего плохого, но я просто подумал, что поделюсь пошаговыми инструкциями для тех, кто впервые проходит через этот процесс.
Как загрузить отдельную папку из репозитория github (Mac OS X):
To open Terminal just click spotlight and type terminal then hit enter
If you want to checkout the folder rather than simply download it try using the svn help (tldr: replace export with checkout)
Обновлять
Кто бы ни работал с конкретной папкой, ему необходимо клонировать эту конкретную папку, для этого выполните следующие шаги, используя разреженную проверку.
Инициализировать репозиторий Git. ( git init )
Включить разреженные проверки. ( git config core.sparsecheckout true )
Получить файлы ( git pull origin master )
Ты не можешь; В отличие от Subversion, где каждый подкаталог может быть извлечен индивидуально, Git работает на основе всего репозитория.
Итоги 2019 г.
Есть множество способов справиться с этим, в зависимости от того, хотите ли вы сделать это вручную или программно.
Кроме того, я опубликовал аналогичный ответ на StackOverflow для тех, кому нужно загружать отдельные файлы с GitHub (в отличие от папок).
1. Пользовательский интерфейс GitHub
2. Сторонние инструменты
3. Подрывная деятельность
GitHub Community
How can I download a specific folder or directory from a remote Git repo hosted on GitHub? I only want just that a specific folder where the files for the front-end part of the app are kept, without having the other files as I don’t really need them.
Beta Was this translation helpful? Give feedback.
100 You must be logged in to vote
If you are willing to use git to do this, you can do a sparse checkout.
We are going to start by creating an empty git repo locally, and then add the repository we want as a remote. This allows us to easily just checkout the folder we want
After that, we want to add the directory to
(this is essentially the opposite of the gitignore file).
and it should download only the folder you want.
Obviously, this requires you to use git, but it shouldn’t bee too difficult to automate if it’s something you are doing often.
Replies
If you are willing to use git to do this, you can do a sparse checkout.
We are going to start by creating an empty git repo locally, and then add the repository we want as a remote. This allows us to easily just checkout the folder we want
After that, we want to add the directory to
(this is essentially the opposite of the gitignore file).
and it should download only the folder you want.
Obviously, this requires you to use git, but it shouldn’t bee too difficult to automate if it’s something you are doing often.
Beta Was this translation helpful? Give feedback.
Marked as answer
1 You must be logged in to vote
Awesome! Thanks a lot, will definitely try this.
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
I have a specific folder from a remote Git repo that I’ve hosted on GitHub. How can I download only that one specific folder?
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
@nadiajoyce Well this question is different mine is different, I want to download a specific folder locally not on a remote Git repo I think you misunderstood my question please check it once again.I totally understand that in order to maintain forum organized you have close my question but I request you to open again since my question is different from above question.
Beta Was this translation helpful? Give feedback.
GitHub Community
How can I download a specific folder or directory from a remote Git repo hosted on GitHub? I only want just that a specific folder where the files for the front-end part of the app are kept, without having the other files as I don’t really need them.
Beta Was this translation helpful? Give feedback.
100 You must be logged in to vote
If you are willing to use git to do this, you can do a sparse checkout.
We are going to start by creating an empty git repo locally, and then add the repository we want as a remote. This allows us to easily just checkout the folder we want
After that, we want to add the directory to
(this is essentially the opposite of the gitignore file).
and it should download only the folder you want.
Obviously, this requires you to use git, but it shouldn’t bee too difficult to automate if it’s something you are doing often.
Replies
If you are willing to use git to do this, you can do a sparse checkout.
We are going to start by creating an empty git repo locally, and then add the repository we want as a remote. This allows us to easily just checkout the folder we want
After that, we want to add the directory to
(this is essentially the opposite of the gitignore file).
and it should download only the folder you want.
Obviously, this requires you to use git, but it shouldn’t bee too difficult to automate if it’s something you are doing often.
Beta Was this translation helpful? Give feedback.
Marked as answer
1 You must be logged in to vote
Awesome! Thanks a lot, will definitely try this.
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
I have a specific folder from a remote Git repo that I’ve hosted on GitHub. How can I download only that one specific folder?
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
@nadiajoyce Well this question is different mine is different, I want to download a specific folder locally not on a remote Git repo I think you misunderstood my question please check it once again.I totally understand that in order to maintain forum organized you have close my question but I request you to open again since my question is different from above question.
Beta Was this translation helpful? Give feedback.
Источники информации:
- http://github.community/t/how-can-i-download-a-specific-folder-from-a-github-repo/278/2
- http://www.stackfinder.ru/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo
- http://github.community/t/how-can-i-download-a-specific-folder-from-a-github-repo/278/18
- http://github.community/t/how-can-i-download-a-specific-folder-from-a-github-repo/278/12