項目源代碼在客戶服務器,現在需要在我們服務器上傳源碼,同爲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.如果客戶項目有多個分支,切換相應的分支,執行上面最後一行代碼即可(更換分支名爲切換的分支)