博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Git远程仓库地址变更
阅读量:4633 次
发布时间:2019-06-09

本文共 808 字,大约阅读时间需要 2 分钟。

简单方法 使用方法三

方法有很多,这里简单介绍几种:

以下均以项目git_test为例: 

老地址: 
新地址: 
远程仓库名称: origin

方法一 通过命令直接修改远程地址

  1. 进入git_test根目录
  2. git remote 查看所有远程仓库, git remote xxx 查看指定远程仓库地址
  3. git remote set-url origin 

方法二 通过命令先删除再添加远程仓库

  1. 进入git_test根目录
  2. git remote 查看所有远程仓库, git remote xxx 查看指定远程仓库地址
  3. git remote rm origin 
  4. git remote add origin 

方法三 直接修改配置文件

  1. 进入git_test/.git
  2. vim config 

    [core] 
    repositoryformatversion = 0 
    filemode = true 
    logallrefupdates = true 
    precomposeunicode = true 
    [remote "origin"] 
    url = http://192.168.100.235:9797/shimanqiang/assistant.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 
    [branch "master"] 
    remote = origin 
    merge = refs/heads/master

    修改 [remote “origin”]下面的url即可

方法四 通过第三方git客户端修改。

以SourceTree为例,点击 仓库 -> 仓库配置 -> 远程仓库 即可管理此项目中配置的所有远程仓库, 而且这个界面最下方还可以点击编辑配置文件,同样可以完成方法三。

转载于:https://www.cnblogs.com/wangleBlogs/p/8006672.html

你可能感兴趣的文章
linux简单优化
查看>>
洛谷 P1411 树
查看>>
打字游戏--飞机大战
查看>>
文本输入框、密码输入框
查看>>
内联式css样式,直接写在现有的HTML标签中
查看>>
HackerRank - Bricks Game
查看>>
Expect 教程中文版
查看>>
libcurl 客户端实例
查看>>
由Node.js事件驱动模型引发的思考
查看>>
easyUI样式之easyui-switchbutton
查看>>
在raspberry的jessie版系统上安装opencv3.0
查看>>
codeforces水题100道 第二十七题 Codeforces Round #172 (Div. 2) A. Word Capitalization (strings)...
查看>>
maven笔记学习
查看>>
关于学习编程的一些看法
查看>>
oracle操作
查看>>
AngularJS $eval $parse
查看>>
electron 创建窗口2
查看>>
zookeeper
查看>>
MySql的四种事务隔离级别
查看>>
隐藏Nginx版本号的安全性与方法
查看>>