Git: 如何在不下载整个存储库的情况下下载最新版本的存储库文件?
Git: How to download latest version of repository files without downloading the whole repository?
我想从 GitHub 下载 PHPMailer。 URL 如下:
https://github.com/PHPMailer/PHPMailer
我在安装了 git
的 Linux 盒子上。我想下载最新版本的 PHPMailer
而不是下载整个存储库。
这可能吗?我要发出什么 git
命令来实现此目的?
我能够通过以下 Linux 命令实现我想要的:
wget https://github.com/PHPMailer/PHPMailer/archive/master.zip
Git 使用 --single-branch 克隆将只获得所需的分支。
Git 使用 --depth=N 进行克隆将仅获得 N 个最近的提交(--depth=1 将仅克隆 repo HEAD)。
当然,你可以把它们结合起来。但是使用 --depth=N 你将只能看到最近的历史记录(最后 N 次提交)。
我想从 GitHub 下载 PHPMailer。 URL 如下:
https://github.com/PHPMailer/PHPMailer
我在安装了 git
的 Linux 盒子上。我想下载最新版本的 PHPMailer
而不是下载整个存储库。
这可能吗?我要发出什么 git
命令来实现此目的?
我能够通过以下 Linux 命令实现我想要的:
wget https://github.com/PHPMailer/PHPMailer/archive/master.zip
Git 使用 --single-branch 克隆将只获得所需的分支。 Git 使用 --depth=N 进行克隆将仅获得 N 个最近的提交(--depth=1 将仅克隆 repo HEAD)。
当然,你可以把它们结合起来。但是使用 --depth=N 你将只能看到最近的历史记录(最后 N 次提交)。