GitHub Cookbook: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
No edit summary
Line 53: Line 53:
After the password is deleted, a prompt for the new password will appear the next time a GitHub password is required. <ref>[https://gist.github.com/jonjack/bf295d4170edeb00e96fb158f9b1ba3c Update an existing token] - GitHub Gist</ref>
After the password is deleted, a prompt for the new password will appear the next time a GitHub password is required. <ref>[https://gist.github.com/jonjack/bf295d4170edeb00e96fb158f9b1ba3c Update an existing token] - GitHub Gist</ref>


== See Also ==
== Notes ==
 
=== See Also ===
* [[Setting Up a Remote GIT Repository on Windows Server]]
* [[Setting Up a Remote GIT Repository on Windows Server]]
* [[Using Git With Namecheap Web Hosting]]
* [[Using Git With Namecheap Web Hosting]]
=== References ===
<references />

Revision as of 16:45, 1 August 2022


Create a new repo on GitHub

  • Sign in
  • Top Right > user name > plus sign drop down > Create New... > New Repository
  • Enter a name

Create a new local repo from the command line

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/dbarchowsky/damienjay_web.git
git push -u origin master

Push an existing repo from the command line

git remote add origin https://github.com/dbarchowsky/damienjay_web.git
git push -u origin master

Personal access tokens

Accessing and regenerating personal access tokens

GitHub personal access tokens allow access to a private repo via the command line. Personal access tokens must be regenerated periodically for enhanced security. The default period is 30 days, but something like 90 days is more practical.

Personal access tokens are regenerated on the GitHub website > GitHub account dropdown menu (at the top right) > Settings > Developer Settings (at the very bottom of the menu on the left) > Personal Access Tokens

The token that has been in use is named "2FA command line." There are others which may or may not be necessary.

Once the token has been regenerated, accessing private repos on the command line will result in authentication errors.

Updating personal access tokens in CLI (Mac OS)

Check if a GitHub password is stored in the OSX keychain:

$ security find-internet-password -l github.com

If the password is managed by the OSX keychain, delete the existing keyword with:

$ security delete-internet-password -l github.com

After the password is deleted, a prompt for the new password will appear the next time a GitHub password is required. [1]

Notes

See Also

References