两个Git之间同步代码

项目源代码在客户服务器,现在需要在我们服务器上传源码,同为git。

1.先在公司GitLab建立相应的项目。

2.找一个空文件夹拉取客户服务器项目源码

3.执行以下命令:

git config --global user.name "[email protected]"
git config --global user.email "[email protected]"
git init
git remote set-url origin http://xxx.xxx.xx.xxx/xxx/xxxx.git
git push -u origin master

4.如果客户项目有多个分支,切换相应的分支,执行上面最后一行代码即可(更换分支名为切换的分支)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章