现有文件夹添加到git仓库的步骤

保存一下现有文件夹添加到git仓库的步骤(已创建好空的仓库,地址为:https://git.xxx.com/firework/xxx.git

cd existing_folder
git init
git remote add origin https://git.xxx.com/firework/xxx.git
git add .
git commit -m "init"
git push -u origin master

Git :fatal: refusing to merge unrelated histories解决

今天本地创建了一个仓库(有README),把本地仓库和Github上关联以后,发现git pull,git feach提醒fatal: refusing to merge unrelated histories

上网查到原因是两个分支是两个不同的版本,具有不同的提交历史

加一句

git pull origin master --allow-unrelated-histories

可以允许不相关历史提,强制合并,确实解决了这个问题,感谢网友

原创文章请随便转载。愿和大家分享,并且一起进步。-- 江 coder
原文地址:https://www.cnblogs.com/jiangxiaobo/p/13846438.html