zoukankan      html  css  js  c++  java
  • gitlab——项目代码迁移

    https://www.toutiao.com/i6939695478040773150/

    目的:将原来服务器上的项目代码迁移到另一台服务器上。

    step1.

    首先新建一个空文件,将原服务器代码取下来:

    git clone http://***(原服务器代码地址)

    step2.

    进入到取下来的git项目文件夹中:

    cd *****(取下来的项目文件夹路径)

    注:step1和step2相当于拉取线上代码到本地,可以直接用已有的本地代码仓库,跳过1、2步骤。

    step3.

    下面可以参照gitlab给出的提示,首先将原来的origin重命名一下:

    git remote rename origin old-origin

    再指定需要迁移到的目标地址:

    git remote add origin http://***(新服务器代码需要存放的地址)

    注:此时本地仓库便具有两个线上仓库地址,可以切换

    step4.

    上传到新服务器:

    git push origin --all

    上传tag:

    git push origin --tags

    注:如果此时本地仓库具有线上的所有分支,则不需要执行step5。

    step5.

    假如有多个分支的话,就切换到另一个分支,再切换到另一个分支提交:

    git checkout dev(分支名称)

    不知道的话可以通过 git branch -a 查看分支

    切换到dev分支后,再次提交

    git push origin -all

     

    完成项目代码迁移。

  • 相关阅读:
    struts2 标签给iterator添加自然序号
    theirtts2
    zhihutheirTTS1
    theirs《A 2019 Guide to Speech Synthesis with Deep Learning》
    theirmvsnetv00000
    theirmvsnetv2
    theirMeshCNN/
    their MVF-Net: Multi-View 3D Face Morphable Model Regression(2019 CVPR)
    their DenseFusion6dof
    C++35
  • 原文地址:https://www.cnblogs.com/zhoading/p/14763202.html
Copyright © 2011-2022 走看看