Windows下 Pycharm连接Github 教程
Pycharm连接Github
1、File->Settings->Version Control->Github
![](http://upload-images.jianshu.io/upload_images/1948587-6a971b31a20b9389.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
会出现github,然后在旁边输入你github的用户名和密码,可以点击”test”测试一下,如果出现:Connection successful
,则代表连接成功了。
![](http://upload-images.jianshu.io/upload_images/1948587-e01b06d4f7785d27.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2、选择Git安装路径
设置github后选择git,输入你git.exe的安装位置路径,下面是我的git.exe的位置:D:\Git\bin\git.exe
,然后点击OK
。
![](http://upload-images.jianshu.io/upload_images/1948587-7c442c866346474b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
创建Github的仓库
1、VCS->Import Into Version Control->Share Project On Github
![](http://upload-images.jianshu.io/upload_images/1948587-7129c08e0373c039.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后会弹出框让你输入一个仓库名(不能为中文)
![](http://upload-images.jianshu.io/upload_images/1948587-9abb6820a771d96e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后点击share
![](http://upload-images.jianshu.io/upload_images/1948587-3a14b8f227c97546.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后会弹出让你选择哪些文件需要被同步,选好后,在下面的commit Message可以输入自己的信息,然后点OK,你的代码就提交到网上了。可以看看
![](http://upload-images.jianshu.io/upload_images/1948587-ab178b7709e22f45.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
修改后的文件提交
1、对修改后的文件或目录点击右键:Git—>Add,先把文件放入暂存区。
![](http://upload-images.jianshu.io/upload_images/1948587-3f322957ece466ca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2、对修改后的文件或目录点击右键:Git—>Commit File,把刚才add放在暂缓区的文件提交。
![](http://upload-images.jianshu.io/upload_images/1948587-ebfb12920057196f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3、填好commit的信息后,点击下面的commit and Push,可以直接提交到网上。
![](http://upload-images.jianshu.io/upload_images/1948587-769997ae0112b4a6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1948587-1887323016dc64c8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
结束语
Pycharm版本号:
![](https://images2015.cnblogs.com/blog/1039892/201701/1039892-20170110093646650-1090121833.png)
使用pycharm克隆github仓库
前面说的是上传,要下载呢?在VCS菜单中:
根据上图红框选择。
输入密码。
pycharm会登录你的github账户,读取你的仓库信息,你可以从下拉框中选择仓库,也可以在directory name框内
直接输入仓库名。点击clone,pycharm就自动下载仓库内容了。
从github下载项目后要先配置0.0.0.0端口这样也可以从IP地址访问
在pycharm内进行git的相关操作
以上只是commit和clone的操作,具体的push,add,status等git常用操作都在CVS菜单里可以找得到,相信具有
git基础的同学一看就会,这里就不介绍了。
你看,在pycharm中使用github进行版本控制就是这么简单!
觉得不错的话,就点赞支持一下吧!