亲测下面的文章很有用处。
1. 初次使用git上传代码到github远程仓库 - 知乎 (zhihu.com)
2. 使用Git时出现refusing to merge unrelated histories的解决办法 - 知乎