一、创仓库
注意:先添加readme 能避免空仓库 传文件失败
二、准备文件
1.注意父级路径下最好只有一个文件(图中的carl下只有一个test文件)
2.右键git bash here
输入:
git init 初始化仓库
git remote add origin https://github.com/chape/test.git 把当前目录和git仓库绑定
git remote -v 查看远程仓库情况
出现以上提示 则成功绑定仓库
三、开启ideal
在要提交的项目下 打开ideal终端 terminal
git pull origin master --allow-unrelated-histories 开启空仓库拉取权限
回到文件目录下 (不在ideal提交 报错可能性很大)
右键-->commit
回到ideal终端
git push origin master 推送则成功