Last active
June 30, 2025 06:24
-
-
Save teebow1e/7af5d089f6b3f492943157869029dc41 to your computer and use it in GitHub Desktop.
Revisions
-
teebow1e revised this gist
Aug 12, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ssh-keygen -t ed25519 -C "your_email@example.com" ``` 2. Copy the public key (.pub) to clipboard 3. Paste into [GitHub SSH and GPG keys page](https://github.com/settings/keys) 4. Verify the connectivity ```shell -
teebow1e renamed this gist
Jul 24, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
teebow1e revised this gist
Feb 16, 2024 . 1 changed file with 17 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## Get SSH key working 1. Create a SSH key ```shell @@ -27,4 +27,19 @@ ssh-add &>/dev/null || eval `ssh-agent` &>/dev/null } ``` > Sidenote: If you are using SSH key and works with private stuff, you need to interact with them using SSH protocol, not HTTP. ## Signing your Commits 1. Upload your previously-created keys (or just create a new key) to [GitHub SSH and GPG keys page](https://github.com/settings/keys). Make sure to specify it as `Signing Key`. 1.1. Optional - Run this command to always verify your commit in a specific local repo: `git config commit.gpgsign true` - Run this command to always verify your commit: `git config --global commit.gpgsign true` 2. Let Git know about your signing key ```shell git config --global gpg.format ssh git config --global user.signingkey /PATH/TO/.SSH/KEY.PUB ``` 3. Verify by signing a commit ```shell git commit -S -m "<example>" ``` -
teebow1e revised this gist
Feb 16, 2024 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,4 +25,6 @@ ssh-add &>/dev/null || eval `ssh-agent` &>/dev/null [ $? -eq 0 ] && { ssh-add ~/.ssh/<your_key_name> &>/dev/null } ``` > Sidenote: If you are using SSH key and works with private stuff, you need to interact with them using SSH protocol, not HTTP. -
teebow1e renamed this gist
Feb 16, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
teebow1e created this gist
Feb 16, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ ## Step-by-step guide 1. Create a SSH key ```shell ssh-keygen -t rsa -C "your_email@example.com" # this is also okay ssh-keygen -t rsa -b 4096 -C "your_email@example.com" # maybe this (up to your preference) ssh-keygen -t ed25519 -C "your_email@example.com" ``` 2. Copy the key to clipboard 3. Paste into [GitHub SSH and GPG keys page](https://github.com/settings/keys) 4. Verify the connectivity ```shell ssh -T -v git@github.com # or this if you use custom key name (instead of the normal id_rsa) # more information: https://serverfault.com/questions/1119891/ssh-not-working-when-custom-key-name-is-used ssh -T -v -i <custom_file_name> git@github.com ``` 5. By default, for some reason, new session of Bash/ZSH may not load your SSH key, therefore, you need to initialize a SSH agent and load your key each time you start a new session. ```shell ssh-add &>/dev/null || eval `ssh-agent` &>/dev/null [ $? -eq 0 ] && { ssh-add ~/.ssh/<your_key_name> &>/dev/null } ```