Shawn's blog Shawn's blog
About Me
  • Category
  • Tag
  • Archive
GitHub (opens new window)

Shawn Jin

I am not a creator of knowledge, I am just a porter of knowledge.
About Me
  • Category
  • Tag
  • Archive
GitHub (opens new window)
  • Git notify permission denies when pushing

    • Setting up Git
      • Method One:
      • Method Two:
    • Setting up GitHub SSH connection
    Shawn Jin
    2019-10-31
    studyingnotes

    Git notify permission denies when pushing

    # Git notify permission denies when pushing


    When wer are using git push, and got:

    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    1
    2

    There are two causes reasones:

    1. Haven't set up git
    2. Haven't set up SSH connection

    # Setting up Git

    # Method One:

    Using git config to config Git

    $ git config --global user.name "Username"
    $ git config --global user.email email@example.com
    
    1
    2

    These two commands are used for config user name and email information. --global represents it is a global configuration.

    # Method Two:

    You can use editor to config Git

    1. If you want to config git globally,open /etc/gitconfig,and add:
    [user]
        name = Username
        email = YourEmail
    
    1
    2
    3
    1. If you only want to change one user's setting, just edit~/.gitconfig.

    If you want to know more about git, please check Git Official Website (opens new window)。

    # Setting up GitHub SSH connection

    1. You need to generate a SSH key. Open terminal and type:
    $ ssh-keygen -t rsa -C "YourEmail"
    
    1

    You can use all settings as default.

    1. After that, you could get a SSH public key and private key。(Default under:~/.ssh/. Then,copy fileid_rsa.pub that is under that folder.
    2. Click GitHub avatar,click "Settings"
    3. On the side bar,click “SSH and GPG keys” -> "Add SSH key"
    4. Paste the public key file and save。

    笔记

    If it's still not working, or it's not working after reboot. Run ssh-add [private_key_file_path]. If you got error Could not open a connection to your authentication agent., please check this article (opens new window).

    Environment:

    
    
                     -/+:.          
                    :++++.          OS: 64bit Mac OS X 10.14.5 18F132
                   /+++/.           Kernel: x86_64 Darwin 18.6.0
           .:-::- .+/:-``.::-       Uptime: 3d 16h 35m
        .:/++++++/::::/++++++/:`    Packages: 48
      .:///////////////////////:`   Shell: zsh 5.6.2
      ////////////////////////`     Resolution: 2880x1800
     -+++++++++++++++++++++++`      DE: Aqua
     /++++++++++++++++++++++/       WM: Quartz Compositor
     /sssssssssssssssssssssss.      WM Theme: Blue
     :ssssssssssssssssssssssss-     CPU: Intel Core i7-4770HQ @ 2.20GHz
      osssssssssssssssssssssssso/`  GPU: Intel Iris Pro
      `syyyyyyyyyyyyyyyyyyyyyyyy+`  RAM: 8462MiB / 16384MiB
       `ossssssssssssssssssssss/
         :ooooooooooooooooooo+.
          `:+oo+/:-..-:/+o+/-
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    Reference: - [GitHub Guide](https://help.github.com/en/enterprise/2.15/user/articles/adding-a-new-ssh-key-to-your-github-account)
    • CSDN (opens new window)

    • Git (opens new window)

    #Git
    Updated: 2021/09/09, 11:40:27
    最近更新
    01
    Python import files from different directories
    12-31
    02
    Classmethod in Python
    09-15
    03
    Single/Double Star (/*) Parameters in Python
    09-15
    更多文章>
    Theme by Vdoing | Copyright © 2019-2021 Shawn Jin | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式