使用idea,先讲本地代码进行git管理,然后commit。然后配置远程remote地址,远程上增加项目,然后将本地代码提交到git远端,这时候是两个不同的库,关联不上。

push的时候报错 refusing to merge unrelated histories 

参考如下两篇文章。需要使用命令git pull origin master -–allow-unrelated-histories(注意allow前是两个横杠),先将远端的代码拉倒本地。然后才能提交到远程!

https://blog.csdn.net/u012145252/article/details/80628451

https://www.cnblogs.com/xiangxinhouse/p/8254120.html

相关文章:

  • 2021-11-22
  • 2022-12-23
  • 2022-01-07
  • 2021-11-12
  • 2021-12-05
  • 2021-05-30
  • 2021-07-22
猜你喜欢
  • 2022-02-10
  • 2021-06-13
  • 2021-12-21
  • 2022-12-23
  • 2021-08-05
  • 2021-07-08
相关资源
相似解决方案