Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kage08/0570402b7aa4d4c263087452d58a08d9 to your computer and use it in GitHub Desktop.
Save kage08/0570402b7aa4d4c263087452d58a08d9 to your computer and use it in GitHub Desktop.

Revisions

  1. 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]
    ```
  2. 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:
    ```
  3. 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)
  4. 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]
    ```
  5. 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]"
  6. 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.
  7. Bram van Dartel renamed this gist Nov 9, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. 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
    ```
  9. 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!)
    ```