git线上线下合并

一开始我在github上新建了一个仓库,加入了readme和gitignore

然后我在本地新建了一个项目,然后

git init,
git add .
git commit -m "xxxxxx", 

现在线上和线下的两个分支没有关联,使用git pull,这时会提示

fatal: refusing to merge unrelated histories

解决方法:使用

git pull origin master --allow-unrelated-histories

然后会进入vim让你填写merge的原因,点击i编辑,编辑完成以后输入:wq保存并退出

然后再git push就可以了

猜你喜欢

转载自blog.csdn.net/dongdaxiaopenyou/article/details/80811519