现有文件夹添加到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

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM