当前位置:   article > 正文

GIT常见问题及其解决方案

type a secure passphrase 不显示

问题:

remote: Permission to beijing01/learn_github.git denied to liuhongyang02. fatal: unable to access 'https://github.com/beijing01/learn_github.git/': The requested URL returned error: 403

To see what your remotes are you can run:

git remote -v

产生故障的原因是本地密钥和github上不同 解决方法:

Checking for existing SSH keys
  • Open Terminal.
  • enter ls -al ~/.ssh to see if existing SSH keys are present
  • Check the directory listing to see if you already have a public SSH key.

If you don't have an existing public and private key pair, or don't wish to use any that are available to connect to GitHub, then generate a new SSH key.

If you see an existing public and private key pair listed (for example id_rsa.pub and id_rsa) that you would like to use to connect to GitHub, you can add your SSH key to the ssh-agent.

Generating a new SSH key and adding it to the ssh-agent

Open Terminal. Paste the text below, substituting in your GitHub email address.

This creates a new ssh key, using the provided email as a label.

When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

Adding your SSH key to the ssh-agent

Start the ssh-agent in the background.

If you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.

Adding a new SSH key to your GitHub account

Copy the SSH key to your clipboard. If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.

问题: 错误提示:fatal: remote origin already exists.

 

转载于:https://www.cnblogs.com/zhichun/p/11368387.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/409016
推荐阅读
相关标签
  

闽ICP备14008679号