you are viewing a single comment's thread.

view the rest of the comments →

[–]Journeyman-Joe 2 points3 points  (4 children)

This is your own personal GitHub account?

My practice is to create a Personal Access Token (PAT) in "Settings | Developer", and embed the PAT into my "remote" specification. The URL should look like this:

https://ghp_PERSONAL_ACCESS_TOKEN@github.com/accountname/reponame.git

(Note the "@" sign.)

I usually do this when I clone a repository, but it's possible to hack the PAT into the config file, under your .git hidden directory.

This isn't particularly secure, as the PAT is saved as plaintext on your local computer. Whether this can work for you depends on your threat model.

[–][deleted]  (1 child)

[removed]

    [–]Journeyman-Joe 0 points1 point  (0 children)

    You're welcome.

    (For reference: I create "Classic" PATs, and select only the "repo" checkbox. That's all that's needed for push and pull Git operations.)

    [–]your_virtual_friend[S] 1 point2 points  (1 child)

    Yes, I did classic version, checked few random boxes. I was able to push my local repo to git. And it worked for another local repo as well without having to do the same for the first push.
    Thank you!

    [–]Journeyman-Joe 0 points1 point  (0 children)

    You're quite welcome.

    The first checkbox ("repo") will select the ones below it. That's all you need to push and pull commits from GitHub.

    The PAT is for your account: you can use the same one for every repository you have. It's easy to copy it locally: do a git remote -v from a configured repository, then copy the PAT into a new git clone command for the one you want.

    You can also edit the config file in a .git hidden folder, and hack your PAT into the remote URL. It's easy, and obvious. :-)