在IntelliJ中打开项目
在IntelliJ的Terminal中初始化项目
在github上创建同名仓库 tiger
Git Shell中配置远程仓库
cd 项目目录
git remote add origin https://github.com/shuangjiegun/tiger
(中间如果有报错 请参考下边的解决方法
1.fatal: remote origin already exists
git remote rm origin )
git push -u origin master
引起该错误的原因是,目录中没有文件,空目录是不能提交上去的
解决方法
touch README
git add README
git commit -m ‘first commit’
git push -u origin master
这时在github中查看
以后就可以直接在IntelliJ中直接操作项目,直接提交了