Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have still not figured out how to use the new system from the command line. And I am generally rather familiar with git, just not with ssh. Ended up switching a repo to public just in order to be able to use it. Maybe I should try again and hope there are better tutorials around now than a month ago. The Anubis school of infosec https://external-preview.redd.it/-zmkMWw8GlL5REUZmtcKIPj9PtY... is strong on this one.


Sorry I'd tell you how I do it but for OPSEC reasons I cannot...

Haha just kidding, here what's up - this is what a friend of mine does that has nothing to do with my own operations of course. Probably violating many contractual arrangements bigly but honestly the whole security side of this stuff is so anal retentive that I will, for the greater good of my boy generationP.

You just go into your dev settings on GitHub. (Top right when youre on GitHub.com, dev profile pic, click on Settings then on Developer Settings, then you'll be confused because it asks you to register a dumbass GitHub app - ignore this)

Then click on "Personal access tokens" on the lower left of the left most menu.

Then generate with the desired permissions (wow, guess what most people will select in a rush...? shocking, unimaginable...)

Anyways once you have the token, which will only be generated once, so save it down - I just make a environment variable and export it because I have a finite amount of time in my life and this stuff beyond annoys me.

The just repoint your local repo clones to an instance with the following convention:

git://<username>:<personal_access_token>@github.com/<username OR orgname>/<repo name>

Good luck, old sport. Post on here if you have any problems. You can also modify all the crap in your .git subdirectory within a repo but that's deep in the danger zone.


Thanks, but... something's off, and the error message makes no sense:

  $ git remote set-url origin git://<my userid>:<my token>@github.com/<repository owner's userid>/<repository name>

  $ git pull
  fatal: unable to look up <my userid>:<my token>@github.com (port 9418) (Non-recoverable failure in name resolution)
In other news, did I mention that the scopes are a bit confusing? I've checked "repo" and nothing else, based on the empirical assumption that the stuff near the top is the most important, but why don't I need, say, "read:public_key", if I am to use ssh?

(The set-url worked fine -- the new URL is indeed in the .git/config.)


Using username/PAT works with https://, not git://.

An easier route might be GCM Core (https://github.com/microsoft/Git-Credential-Manager-Core). And of course, disclosure, I'm the product manager for GCM Core and author of this blog post.


Thank you! The https solved the problem.

I'll keep your manager in mind for when I need multi-factor auth, which so far hasn't happened.


Sorry about that - was doing it from memory. Apologies, glad you got it fixed.


I'll check this out, thanks for the recommendation.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: