zoukankan      html  css  js  c++  java
  • git-修改远程的URL以及强制覆盖本地文件

    git remote set-url命令修改remote URL

    git remote set-url传递两个参数

    • remote name。例如,origin或者upstream
    • new remote url。例如,git@github.com:USERNAME/OTHERREPOSITORY.git

    例如:从SSH切换到HTTPS的远程URL

    1. 打开终端
    2. 切换到你项目的工作目录
    3. 列出remotes,是为了得到你想要改变的remote的名字
      xxxxxx@xxxxxx:~/workspace/goal$ git remote -v
      origin    git@github.com:xxxxxx/SpringBoot.git (fetch)
      origin    git@github.com:xxxxxx/SpringBoot.git (push)
    4. 使用git remote set-url命令从SSH到HTTPS的远程URL
      xxxxxx@xxxxxx:~/workspace/goal$ git remote set-url origin https://github.com/xxxxxx/SpringBoot.git
    5. 验证是否改变成功
      xxxxxx@xxxxxx:~/workspace/goal$ git remote -v
      origin    https://github.com:xxxxxx/SpringBoot.git (fetch)
      origin    https://github.com:xxxxxx/SpringBoot.git (push)

     

    Git 强制覆盖本地文件。
    git fetch --all git reset --hard origin/master
    git pull
  • 相关阅读:
    网站搜索功能lucene
    RabbitMQ消息队列
    zookeeper
    RPC+SOA+dubbo
    石英定时任务-quartz
    通用mapper、图片上传、nginx
    通用mapper和分类实现
    后台商品管理功能实现
    构建框架
    海量数据的并发处理
  • 原文地址:https://www.cnblogs.com/Starshot/p/7412112.html
Copyright © 2011-2022 走看看