Skip to content

Instantly share code, notes, and snippets.

@xirixiz
Forked from developius/README.md
Last active October 22, 2025 16:15
Show Gist options
  • Save xirixiz/b6b0c6f4917ce17a90e00f9b60566278 to your computer and use it in GitHub Desktop.
Save xirixiz/b6b0c6f4917ce17a90e00f9b60566278 to your computer and use it in GitHub Desktop.

Revisions

  1. Bram van Dartel revised this gist Jun 20, 2024. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,10 @@ Change directory into the local clone of your repository (if you're not already
    ```
    git remote set-url origin [email protected]:username/your-repository.git
    ```
    If the repo is under an organization the command is slightly different:
    ```
    git remote set-url origin [email protected]:organization/your-repo.git
    ```

    Now try editing a file (try the README) and then do:
    ```
  2. Bram van Dartel revised this gist Jan 7, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ or even better:
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
    ```

    It also possible to use ed25519. There are pros and cons, but personally I've had some issues and therefore chosen to stik to 4096 rsa.
    It also possible to use ed25519. There are pros and cons, but personally I've had some issues and that is the reason I've chosen to stick to 4096 rsa for now.

    ### Copy the contents of the public SSH key

  3. Bram van Dartel revised this gist Jan 7, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ or even better:
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
    ```

    It also possible to use ed25519. There are pros and cons, but personally I've had some issues and therefore chosen to stik to 4096 rsa.

    ### Copy the contents of the public SSH key

  4. Bram van Dartel revised this gist Jan 7, 2023. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -59,4 +59,9 @@ git commit -am "Update README.md"
    git push
    ```

    Add the key to the ssh-agent
    ```
    ssh-add ~/.ssh/id_rsa
    ```

    You should not be asked for a username or password. If it works, your SSH key is correctly configured.
  5. Bram van Dartel revised this gist Jul 13, 2021. 1 changed file with 11 additions and 6 deletions.
    17 changes: 11 additions & 6 deletions Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    # SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)
    ## SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

    ## Create a repo.

    ### 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):

    ### 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

    ### 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 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:

    ### Test the SSH key:
    ```
    ssh -T [email protected]
    ```
  6. Bram van Dartel revised this gist Jul 13, 2021. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # SSH keypair setup for GitHub (or other git server products)
    # 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 public SSH key
    ## 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 file ~/.ssh/id_rsa.pub to your SSH keys to your GitHub account settings (https://github.com/settings/keys).
    Copy the contents of the to your SSH keys to your GitHub account settings (https://github.com/settings/keys).

    ## Test the SSH key:
    ```
  7. Bram van Dartel revised this gist Jul 13, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # SSH Key setup
    # 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)
  8. Bram van Dartel revised this gist Jul 13, 2021. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions Set up GitHub push with SSH keys.md
    Original 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)
    Make sure there is at least one file in it (even just the README.md)

    ## Generate ssh key:
    ## 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 SSH Key and Use them
    ## Copy the public SSH key

    macOS:
    ```
    @@ -32,9 +32,10 @@ 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).
    ## 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:
    ## Test the SSH key:
    ```
    ssh -T [email protected]
    ```
  9. Bram van Dartel revised this gist Jul 13, 2021. 1 changed file with 2 additions and 21 deletions.
    23 changes: 2 additions & 21 deletions Set up GitHub push with SSH keys.md
    Original 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)

    ## 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]"
  10. Bram van Dartel revised this gist Jul 13, 2021. 1 changed file with 59 additions and 10 deletions.
    69 changes: 59 additions & 10 deletions Set up GitHub push with SSH keys.md
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,73 @@
    Create a repo.
    ## Create a repo.
    Make sure there is at least one file in it (even just the README)
    Generate ssh key:

    ## 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]"
    ```
    Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings.
    Test SSH key:

    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]
    clone the repo:
    git clone git://github.com/username/your-repository
    ```
    Now cd to your git clone folder and do:

    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:

    Now try editing a file (try the README) and then do:
    ```
    git add -A
    git commit -am "my update msg"
    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.
  11. Bram van Dartel renamed this gist Nov 9, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  12. Finnian Anderson revised this gist Mar 24, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions setup.md
    Original 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 (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!)
    git add -A
    git commit -am "my update msg"
    git push
    ```
  13. Finnian Anderson created this gist Mar 24, 2015.
    24 changes: 24 additions & 0 deletions setup.md
    Original 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!)
    ```