登录注册
github一般在白天是可以直接访问的,不需要挂梯子,晚上一般需要vpn才能打开。
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221028220559829-1152733958.png)
注册按照引导完成就可以了
主页
主页功能和布局
项目仓库
仓库视图
新建仓库
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221028221350538-55724732.png)
仓库主页
如何克隆项目代码
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221028221857033-1672524206.png)
克隆项目代码:
前置条件:安装Git
git下载
链接:Git-2.38.1-64-bit.exe - 蓝奏云 (lanzoub.com)
git安装配置
教程:Git 详细安装教程(详解 Git 安装过程的每一个步骤)
图解git原理
:图解Git (marklodato.github.io)
进入cmd
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221028222357121-312629687.png)
然后输入git clone 项目地址
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221028222449229-753777455.png)
上传代码和文件到github
参考教程:Git将本地仓库上传到github - 孤飞 - 博客园 (cnblogs.com)
导入项目到IDE
以JetBrain的PyCharm为例:
在起始页面下
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029100526155-1605600821.png)
填写github仓库地址,然后点击clone
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029100805192-274045963.png)
项目内页
在VCS
-Get from Version Control
导入github项目
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029101409506-1968971885.png)
下载完项目仓库后会弹出一个对话框,自选
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029101705918-852571062.png)
如果初始化或者导入为一个github项目之后就可以使用版本控制工具了
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029102213782-1729938436.png)
在IDE集成开发环境中就不需要用命令行提交代码了,直接点击就好
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029102411820-86730732.png)
关于协作
添加合作者
在github打开指定项目进入setting
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029102742971-1054957020.png)
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029102834346-1533711273.png)
被邀请者需要进入这个github仓库网页【项目仓库主页顶部一行蓝色的邀请函】选择接受邀请
接受邀请后就可以push了
push之前需要在ide登录自己的github账号
教程:Pycharm+github上传及提交代码_你是太阳暖人心的博客-CSDN博客
也就是File-setting配置git和github账号
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029103348325-1377369698.png)
其中git配置
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029103432765-1705655237.png)
其中Github登录
在github个人主页中选择Setting
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029103702211-1141201815.png)
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029104054155-1404753885.png)
在Pycahrm中登录
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029103517201-381822925.png)
直接点击Generate
也可以获取相应权限登Token,而且更快
![](https://img2023.cnblogs.com/blog/2910984/202212/2910984-20221221160054524-486268715.png)
使用github和git的常见问题
push失败
push失败一般是由于github连接超时导致的
![](https://img2022.cnblogs.com/blog/2910984/202210/2910984-20221029105106245-328292962.png)
解决方法有
- 关闭重启编辑器ide
- 关闭或打开clash代理
- 在终端中输入以下代码
git config --global http.sslVerify "false"
git config --global https.sslVerify "false"
git config --global --unset http.proxy
git config --global --unset https.proxy
其实更加有用的解决方案是: