Jon Sud
Jon Sud

Reputation: 11641

How to attach token to git command?

I have a private repo in github.

I can't run git command to show all the tags because I'm not authorize: git ls-remote -t https://github.com/.../..git.

Is there a way to add a token or access key to this command that allow me to execute this command?

something like: git ls-remote -t https://github.com/../...git -token blabla

Upvotes: 2

Views: 1960

Answers (2)

Shlomi Levi
Shlomi Levi

Reputation: 3305

Follow those steps:

  1. Go to your profile settings in Github.
  2. In "developer settings" create a key.
  3. use the key in the url: git ls-remote -t https://youuser:[email protected]/../...git

This key is particularly sensitive.

hope it helps you

Upvotes: 2

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72755

If you can shift to using ssh ([email protected]... URLs) instead of https, your keypair will automatically take care of auth without having to manually enter passwords.

Upvotes: 1

Related Questions