让Git与GitHub关联,使PyCharm的代码直接通过Git提交
1、git输入命令
$ ssh-keygen -t rsa -C "your@email.com"(请填你设置的邮箱地址)
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):
输入你自己设置的密码后,请直接按下回车。
然后系统会自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,存放地址:C:\Users\Plandy\.ssh
用记事本打开id_rsa.pub
将全部的内容复制
2、打开https://github.com/,登陆你的账户,进入设置
进入ssh设置
在key中将刚刚复制的粘贴进去
点击[Add SSH Key]完成新建SSH Key。
5、在git中输入命令:
github用命令: ssh -T git@github.com
输入命令:yes
出现如上提示,请输入git init
否则会出现“fatal: not a git repository (or any of the parent directories): .git”提示
如下:
6.将远程仓库和本地仓库关联起来
先到Github上复制远程仓库的SSH地址:
运行 git remote add origin 你复制的地址
:
关联已经完成!