一、pycharm -->发布到--> github:
1.github 账号密码 https://github.com/
2.git 下载安装 https://git-scm.com/
3.配置git得到密钥: # 参考 https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Git Bash
$ ls -al ~/.ssh # 检查现有的SSH密钥 若是没有就生成
$ ssh-keygen -t rsa -b 4096 -C "email" # email是github上得email
回车:出现(密码可省略)
+---[RSA 4096]----+
| |
| |
| |
| . . |
|O . = + S |
|*O * * X |
|o+*.B * * . |
|o.=+.BEB . . |
|++.o+.=+*.. |
+----[SHA256]-----+ 表示 C:\Users\bj\.ssh文件 id_rsa(私钥) id_rsa.pub(公钥)
4.打开github网页 --> settings --> SSH and GPG keys --> 添加SSH keys --> title(mykey) --> 将id_rsa.pub(公钥)内容复制过来!
5.Git Bash:
$ ssh -T git@github.com # 验证是否成功
...
Are you sure you want to continue connecting (yes/no)? yes
...
Hi alice-bj! You've successfully authenticated, but GitHub does not provide shell access.
...
#设置username和email:
$ git config --global user.name "name" # name github的登录名
$ git config --global user.email "email" # email github注册邮箱
6.配置pycharm:
File --> Settings --> Version Control --> GitHub(输入github的账号,密码, Test测试看是否连接成功!)
File --> Settings --> Version Control --> Git(选择好git.exe的安装路径,Test测试看是否连接成功!)
7.pycharm发布到github上:
pycharm --> 顶部菜单栏VCS --> Import into Version Control --> Share Project on GitHub --> 新建仓库名 --> share --> ok
8.登录github # https://github.com/ --> 便能看到代码上传成功!
-----------------------------------------------
二、github -->下载到--> pycharm:
1.pycharm --> 顶部菜单栏VCS --> Checkout from Version Control --> GitHub --> 选择下载的路径 --> ok
-----------------------------------------------
三、pycharm -->修改-->更新-->github
1.文件右键 --> Git --> Commit File
2.文件右键 --> Git --> Repository --> Push