tramp-man
tramp-man

Reputation: 83

Github curl how to include username and password

Hi all I have the following that works fine as long as I set the repository to public.

curl -L https://api.github.com/repos/myrepos/myrepo/zipball > test.zp

But the repository is private.

Does anyone know how I can include my username and password into it?
Or better still have an example of how I can download it using a c# console app

Upvotes: 1

Views: 7204

Answers (2)

ejazazeem
ejazazeem

Reputation: 551

Create personal OAuth token from Developer Settings

Then

curl -H "Authorization: token <your token here>" \
-L https://api.github.com/repos/<repo-owner>/<repo-name>/tarball > repo.tar.gz

This is explained in this answer stackoverflow.com/questions/9504791...

Upvotes: 1

VonC
VonC

Reputation: 1323115

Following this tutorial, the simplest solution is:

curl --user "caspyin:PASSWD" ...

But the best practice is to avoid using the password directly in a command, and use a oauth token instead (associated to your GitHub account).

curl -H "Authorization: token <yourToken>" ...

Upvotes: 2

Related Questions