GIT操作

Posted 冷幽篁

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GIT操作相关的知识,希望对你有一定的参考价值。

一、git clone

从远程拷贝别人的库来使用

$ git clone <版本库的网址>
$ git clone  https://github.com/taotao8810/TianChi-Game.git

添加一个自己的远程仓库

$ git remote add origin https://github.com/taotao8810/xxxxx.git

 

如何去解决fatal: refusing to merge unrelated histories
先pull,因为两个仓库不同,发现refusing to merge unrelated histories,无法pull
因为他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码

git pull origin master --allow-unrelated-histories

 

以上是关于GIT操作的主要内容,如果未能解决你的问题,请参考以下文章