git 下载,而不是克隆获取等

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4161692/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 09:27:55  来源:igfitidea点击:

git download, not clone fetch etc

gitgithub

提问by lukemh

Ok, so i want a command line tool to download a github repo without creating a local git repo.

好的,所以我想要一个命令行工具来下载 github 存储库,而无需创建本地 git 存储库。

One idea is a download tool to download github zips from a url like

一个想法是一个下载工具,从一个 url 下载 github zips

https://github.com/lukeholder/fuel-website/zipball/master

https://github.com/lukeholder/fuel-website/zipball/master

im on windows 7 and dont want to have to install curl or wget. only native tool?

我在 Windows 7 上,不想安装 curl 或 wget。只有原生工具?

it would preferable to not download a zip but just somehow clone the repo and not have the local git repo ever created.

最好不要下载 zip,而只是以某种方式克隆 repo,而不要创建本地 git repo。

ideas without using git? In effect it would be a git clone and del .git directory

不使用 git 的想法?实际上它是一个 git clone 和 del .git 目录

采纳答案by Pace

If you were willing to still use git (just not create a repository) you could do it with git archiveas explained in this question.

如果您仍然愿意使用 git(只是不创建存储库),您可以git archive按照本问题中的说明进行操作。

回答by SierraJuliet

Immediately above the main directory (to the right) for the folder/files being viewed is a tab with a URLand a "Download" buttonto pull all the files.

正在查看的文件夹/文件的主目录正上方(右侧)是一个带有URL的选项卡和一个“下载”按钮,用于拉取所有文件。

If you DO NOTsee those options then you must click the directory link above the viewing area (i.e. some name > some folder > some other folder) to essentially back out of the directory until you see the option to "Download"and that is the entire compressed file to be downloaded.

如果您没有看到这些选项,那么您必须单击查看区域上方的目录链接(即某个名称 > 某个文件夹 > 某个其他文件夹)以基本上退出目录,直到您看到“下载”选项,这就是要下载的整个压缩文件。