Skip to content

Instantly share code, notes, and snippets.

@JonnyTech
Last active August 20, 2023 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonnyTech/b8b3e2e9c61e50f6abc0740b85124728 to your computer and use it in GitHub Desktop.
Save JonnyTech/b8b3e2e9c61e50f6abc0740b85124728 to your computer and use it in GitHub Desktop.
git guide
ssh-keygen -t ed25519 -C "name[at]domain[dot]tld"
>> keyfile ie /home/user/.ssh/github
>> passphrase and confirm
https://github.com/settings/ssh/new
cat /home/user/.ssh/github
>> authentication key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github
ssh -vT git@github.com
gpg -K --keyid-format SHORT
gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
>> long string at and of sec value
gpg --armor --export <sec value>
>> copy whole block including ---'s
https://github.com/settings/gpg/new
https://github.com/settings/tokens/new
>> name, repo status
>> copy and save pat
git config --global user.name "username"
git config --global user.email "name[at]domain[dot]tld"
git config --global user.email "ID+username@users.noreply.github.com"
git config --global color.ui auto
git clone https://github.com/username/repo
>> write code :)
git log
git status
git diff --cached
git diff HEAD
git add .
>> ensure that git and gpg key email addresses are identical
git commit -S -m "commit title/brief" -m "commit decription"
>> enter gpg secret
git push
>> username, pat
git log --show-signature
@JonnyTech
Copy link
Author

For GitHub’s verified signature use GPG key and GitHub noreply email

@JonnyTech
Copy link
Author

Note, new email format from https://github.com/settings/emails: ID+username@users.noreply.github.com - use for both key generation and code signing, and use PAT:repo for git cli uploads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment