Forked from xirixiz/Set up GitHub push with SSH keys.md
Created
March 10, 2022 13:50
-
-
Save kage08/0570402b7aa4d4c263087452d58a08d9 to your computer and use it in GitHub Desktop.
Revisions
-
Bram van Dartel revised this gist
Jul 13, 2021 . 1 changed file with 11 additions and 6 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,9 +1,11 @@ ## SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc) ### Create a repo. Make sure there is at least one file in it (even just the README.md) ### Generate a SSH key pair (private/public): ``` ssh-keygen -t rsa -C "[email protected]" ``` @@ -13,7 +15,8 @@ or even better: ssh-keygen -t rsa -b 4096 -C "[email protected]" ``` ### Copy the contents of the public SSH key macOS: ``` @@ -34,10 +37,12 @@ cat ~/.ssh/id_rsa.pub | clip or ofcourse copy it via your favorite editor, cat, or whatever suits your needs :) ### Copy the public SSH key to GitHub Copy the contents of the to your SSH keys to your GitHub account settings (https://github.com/settings/keys). ### Test the SSH key: ``` ssh -T [email protected] ``` -
Bram van Dartel revised this gist
Jul 13, 2021 . 1 changed file with 5 additions and 3 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 @@ # SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc) ## Create a repo. Make sure there is at least one file in it (even just the README.md) @@ -13,7 +13,7 @@ or even better: ssh-keygen -t rsa -b 4096 -C "[email protected]" ``` ## Copy the contents of the public SSH key macOS: ``` @@ -32,8 +32,10 @@ Git Bash on Windows / Windows PowerShell: cat ~/.ssh/id_rsa.pub | clip ``` or ofcourse copy it via your favorite editor, cat, or whatever suits your needs :) ## Copy the public SSH key to GitHub Copy the contents of the to your SSH keys to your GitHub account settings (https://github.com/settings/keys). ## Test the SSH key: ``` -
Bram van Dartel revised this gist
Jul 13, 2021 . 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 @@ -1,4 +1,4 @@ # SSH keypair setup for GitHub (or other git server products) ## Create a repo. Make sure there is at least one file in it (even just the README.md) -
Bram van Dartel revised this gist
Jul 13, 2021 . 1 changed file with 6 additions and 5 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,9 +1,9 @@ # SSH Key setup ## Create a repo. Make sure there is at least one file in it (even just the README.md) ## Generate a SSH key pair (private/public): ``` ssh-keygen -t rsa -C "[email protected]" ``` @@ -13,7 +13,7 @@ or even better: ssh-keygen -t rsa -b 4096 -C "[email protected]" ``` ## Copy the public SSH key macOS: ``` @@ -32,9 +32,10 @@ Git Bash on Windows / Windows PowerShell: cat ~/.ssh/id_rsa.pub | clip ``` ## Copy the public SSH key to GitHub Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys to your GitHub account settings (https://github.com/settings/keys). ## Test the SSH key: ``` ssh -T [email protected] ``` -
Bram van Dartel revised this gist
Jul 13, 2021 . 1 changed file with 2 additions and 21 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,27 +1,8 @@ # SSH Key setup ## Create a repo. Make sure there is at least one file in it (even just the README) ## Generate ssh key: ``` ssh-keygen -t rsa -C "[email protected]" -
Bram van Dartel revised this gist
Jul 13, 2021 . 1 changed file with 59 additions and 10 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,24 +1,73 @@ ## Create a repo. Make sure there is at least one file in it (even just the README) ## Copy SSH Key and Use them macOS: ``` pbcopy < ~/.ssh/id_rsa.pub ``` GNU/Linux (requires the xclip package): ``` xclip -sel clip < ~/.ssh/id_rsa.pub ``` Windows Command Line: ``` type %userprofile%\.ssh\id_rsa.pub | clip ``` Git Bash on Windows / Windows PowerShell: ``` cat ~/.ssh/id_rsa.pub | clip ``` ## Generate ssh key: ``` ssh-keygen -t rsa -C "[email protected]" ``` or even better: ``` ssh-keygen -t rsa -b 4096 -C "[email protected]" ``` ## Copy SSH Key and Use them macOS: ``` pbcopy < ~/.ssh/id_rsa.pub ``` GNU/Linux (requires the xclip package): ``` xclip -sel clip < ~/.ssh/id_rsa.pub ``` Windows Command Line: ``` type %userprofile%\.ssh\id_rsa.pub | clip ``` Git Bash on Windows / Windows PowerShell: ``` cat ~/.ssh/id_rsa.pub | clip ``` Copy the contents of the file ~/.ssh/id_rsa.pub or ~/.ssh/id_ed25519.pub to your SSH keys to your GitHub account settings (https://github.com/settings/keys). Test the SSH key: ``` ssh -T [email protected] ``` Change directory into the local clone of your repository (if you're not already there) and run: ``` git remote set-url origin [email protected]:username/your-repository.git ``` Now try editing a file (try the README) and then do: ``` git add -A git commit -am "Update README.md" git push ``` You should not be asked for a username or password. If it works, your SSH key is correctly configured. -
Bram van Dartel renamed this gist
Nov 9, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Finnian Anderson revised this gist
Mar 24, 2015 . 1 changed file with 3 additions and 3 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 @@ -18,7 +18,7 @@ git remote set-url origin [email protected]:username/your-repository.git Now try editing a file (try the README) and then do: ``` git add -A git commit -am "my update msg" git push ``` -
Finnian Anderson created this gist
Mar 24, 2015 .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,24 @@ Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key: ``` ssh-keygen -t rsa -C "[email protected]" ``` Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key: ``` ssh -T [email protected] clone the repo: git clone git://github.com/username/your-repository ``` Now cd to your git clone folder and do: ``` git remote set-url origin [email protected]:username/your-repository.git ``` Now try editing a file (try the README) and then do: ``` git add -A (adds all files in that folder - excluding hidden files - to the commit file list.) git commit -a (all) -m "my update msg" git push (GO GO GO!) ```