zoukankan      html  css  js  c++  java
  • git:修改项目的remote地址(git version 2.30.2)

    一,第一种方法:用remove命令删除origin

    例子:我们把地址从apiweb1修改为apiweb2
    查看remote
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote -v
    origin  https://gitee.com/liuhongdi/apiweb1.git (fetch)
    origin  https://gitee.com/liuhongdi/apiweb1.git (push)
    删除remote的origin
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote remove origin
    查看效果
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote -v
    添加remote
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote add origin https://gitee.com/liuhongdi/apiweb2.git
    查看效果
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote -v
    origin  https://gitee.com/liuhongdi/apiweb2.git (fetch)
    origin  https://gitee.com/liuhongdi/apiweb2.git (push)

    说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest

             对应的源码可以访问这里获取: https://github.com/liuhongdi/
             或: https://gitee.com/liuhongdi

    说明:作者:刘宏缔 邮箱: 371125307@qq.com

     

    二,第二种方法:用set-url命令

    例子:把remote的地址从apiweb2修改为apiweb:
    查看当前的remote
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote -v
    origin  https://gitee.com/liuhongdi/apiweb2.git (fetch)
    origin  https://gitee.com/liuhongdi/apiweb2.git (push)
    用set-url进行设置
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote set-url origin https://gitee.com/liuhongdi/apiweb.git
    查看效果
    liuhongdi@lhdpc:/data/vue/apiweb$ git remote -v
    origin  https://gitee.com/liuhongdi/apiweb.git (fetch)
    origin  https://gitee.com/liuhongdi/apiweb.git (push)

    三,查看git的版本:

    liuhongdi@lhdpc:/data/vue/apiweb$ git --version
    git version 2.30.2 
  • 相关阅读:
    shell 脚本语法
    discuz pre_forum_postposition表说明
    PHP调试工具Xdebug安装配置教程
    检查用户头像状态的脚本
    PHP 性能监测
    Mysql 索引优化
    MySQL主从复制配置
    vue mixin 混入
    vue渲染方式:render和template的区别
    vue自定义指令directive Vue.directive() directives
  • 原文地址:https://www.cnblogs.com/architectforest/p/15330834.html
Copyright © 2011-2022 走看看