IDEA github

1.配置远程提交

1.1 github上创建仓库

1.2 Git Shell中配置远程仓库

 

1 cd 项目目录
2  
3 git remote add origin https://github.com/liming495/xxx.git
4  
5 git push -u origin master

中间如果有报错 请参考下边的解决方法

1.fatal: remote origin already exists

1 git remote rm origin

2.error: Could not remove config section 'remote.origin'

需要修改gitconfig文件的内容 找到github的安装路径,我是

C:\Users\Administrator\AppData\Local\GitHub\PortableGit_0f65d050d0c352
找到一个名为gitconfig的文件,打开它把里面的[remote "origin"]那一行删掉

重启gitshell  执行上述操作

1.3 Intellij IDEA中进行push/pull

右键项目 Git——Repository——Push 

在开发过程中 我们可以使用本地的git进行版本管理  最后使用push进行远程提交

1.4 多人协作开发

在Github 项目的 settings——Collaborators 下可以添加项目成员

被添加的用户 可以提交代码到当前项目中

扫描二维码关注公众号,回复: 1200121 查看本文章

 

2.另一种简单方法

在github上创建仓库后 复制仓库地址 比如 https://github.com/liming495/xxx.git

在intelij中 VCS——Checkout from Version Contrl——Git中 粘贴仓库url地址

会从github仓库中拷贝一份项目   然后就可以在本地直接进行git操作

并且可以push到github仓库中 (会提示你输入github的仓库和密码)

猜你喜欢

转载自liming495.iteye.com/blog/2018545