1. 在GitHub上创建仓库
2. 创建本地项目
3. 在本地项目目录初始化仓库
git init
4. 连接仓库 (建议使用ssh方式)
git remote add origin 仓库地址
5. 强制拉取合并
git pull origin master —allow-unrelated-histories
6. 老三样
git add .
git commit -m 'commit描述'
或者合并上次commit 使用命令:git commit --amend -m 'commit描述'
git push origin master
参考: