• Git-远程仓库的使用


    Git修改远程仓库地址

      1.修改命令
      git remote set-url origin [url]

      例如:$ git remote set-url origin gitlab@gitlab.chumob.com:php/hasoffer.git

      2.先删后加

      git remote rm origin
      git remote add origin [url]

    Git查看远程仓库的名称和对应的克隆地址

      1.查看远程仓库的名称

      git remote

      2.查看远程仓库的克隆地址

      git remote -v

    Git添加远程仓库

      git remote add [shortname] [url]

      例如:$ git remote add pb git://github.com/paulboone/ticgit.git

      解释: pb指代对应的仓库名称,我们如果推送到远程仓库,就可以选择pb这仓库,git push pb master 这样就推送到 远程pb仓库的master分之了。

    Git查看远程仓库信息

      git remote show [remote-name]

      例如:$ git remote show origin

        * remote origin
          Fetch URL: https://gitee.com/huayicompany/think-in-java-4th.git
          Push URL: https://gitee.com/huayicompany/think-in-java-4th.git
          HEAD branch: master
          Remote branch:
            master tracked
          Local branch configured for 'git pull':
            master merges with remote master
          Local ref configured for 'git push':
            master pushes to master (up to date)

    Git删除远程仓库和重命名

      1. 删除远程仓库

      git remote rm [repository name]

      2.重命名远程仓库

      git remote rename [old name] [new name]

     Git 推送远程仓库

      git push [repository name] [branch name]

    Git 拉取远程仓库

      git pull [repository name] [branch name] 或者

      git fetch

      解释:git pull 会自动合并远程仓库的内容到本地仓库,fetch不会自动合并

    Git查看远程与本地的差异

      git fetch origin

      git diff master origin/master --minimal

    参考:

    [1] 网络教程, https://git-scm.com/book/zh/v1/Git-%E5%9F%BA%E7%A1%80-%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8

  • 相关阅读:
    【5】TensorFlow光速入门-图片分类完整代码
    【4】TensorFlow光速入门-保存模型及加载模型并使用
    科研数据库结构
    高并发请求的缓存设计策略
    iOS-KVC的原理
    iOS-KVO的原理
    Kafka too many open files问题解决
    VLOOKUP函数-Excel
    arcgis sql 字符串替换
    ArcGIS矢量转栅格再发布切片服务,还是直接发布切片服务?有何区别?
  • 原文地址:https://www.cnblogs.com/happyflyingpig/p/7833387.html
Copyright © 2020-2023  润新知