Pycharm Error "fatal: Could not read from remote repository."

pycharm 配置github,出现错误:

Push failed: Failed with error: fatal: Could not read from remote repository.

根据查找:

http://danielhnyk.cz/pycharm-error-fatal-could-not-read-remote-repository/

I just encountered very unpleasant error with Pycharm when trying to push or pull to my private repository:

Git Pull Failed: fatal: Could not read from remote repository.

The problem and solution is as follows. I use SSH key for login into GitHub and Pycharm needs to know about it. Unfortunately, Pycharm supposes that your key to GitHub is exactly in ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub. So solution is to create symlinks:

cd ~/.ssh
ln -s github_key_name id_rsa
ln -s github_key_name.pub id_rsa.pub

Everything should work now.

------------------------------------------------------

安装Git成功后,如果是Windows下,选择Git Bash,在命令行中完成一切,可能开始有点麻烦,不过就那几条命令行,用几次就记住啦。首先初始设置Git:

1 git config --global user.name "Your Real Name"
2 git config --global user.email [email protected]

然后开始进行最麻烦的一步了,你需要上传文件到GitHub的Git系统上,得需要一个SSH密匙来认证,下面就开始生成密钥和提交密钥。打开Git Bash,创建SSH key:

1 ssh-keygen -C '[email protected]' -t rsa

然后要你输入SSH密匙的存放位置,可以不管,直接回车使用默认路径。再输入你想要的密码,SSH key就生成了。现在你需要将这个Key提交到GitHub,首先打开Key保存的位置,里面会有三个文件,找到id_rsa.pub,用文本编辑器打开,复制里面的全部字符。到GitHub,在右上方工具栏里找到Account Settings。在这个页面上有一个SSH Public Keys标签,选择Add another public key。Title可以随便填一个,Key就粘贴刚才的字符,提交。


你可能感兴趣的:(pycharm,github,git)