John Sonderson
John Sonderson

Reputation: 3388

Git: How to download latest version of repository files without downloading the whole repository?

I would like to download PHPMailer from GitHub. The URL is the following:

https://github.com/PHPMailer/PHPMailer

I am on a Linux box with git installed. I want to download the latest version of PHPMailer without downloading the whole repository.

Is this possible? What git command do I issue to achieve this?

Upvotes: 0

Views: 935

Answers (2)

smyatkin_max
smyatkin_max

Reputation: 365

Git clone with --single-branch will get only the branch desired. Git clone with --depth=N will get only the N most recent commits (--depth=1 will clone only repo HEAD).

Ofc, you can combine them. But with --depth=N you will be able to see only the most recent history (of last N commits).

Upvotes: 1

John Sonderson
John Sonderson

Reputation: 3388

I was able to achieve what I wanted with the following Linux command:

 wget https://github.com/PHPMailer/PHPMailer/archive/master.zip

Upvotes: 0

Related Questions