zoukankan      html  css  js  c++  java
  • Git 远程仓库

    应用情景1:先创建远程仓库 remote_repo(空的),再创建本地仓库 local_repo,然后关联远程仓库。

    应用情景2:已有远程仓库 remote_repo(可以非空),本地直接克隆远程仓库。

    情景1:

    1、先创建远程空仓库 remote_repo,获取URL:

      SSH:git@github.com:xxx/helloworld.git

      HTTPS:https://github.com/xxx/helloworld.git

      这里是在 GitHub 上面创建的远程仓库,两种 URL 任选其一使用即可,其中xxx代表用户名,具体区别不解释。

    2、如果此时还没有本地仓库,先创建本地仓库 local_repo 然后关联远程仓库。本地仓库名称可随意取,一般与远程仓库同名比较好:

    mkdir local_repo
    cd local_repo
    git init
    touch README
    git add README
    git commit -m 'first commit'
    git remote add origin git@gitlab:xxx/remote_repo.git
    git push -u origin master

    3、如果已经有本地仓库  local_repo 了,此时需要做的就是关联远程仓库:

    cd local_repo
    git remote add origin git@gitlab:xxx/remote_repo.git
    git push -u origin master

    情景2:

    1、直接获取远程仓库URL,克隆到本地,本地仓库名称默认与远程仓库同名:

     git clone git@github.com:xxx/remote_repo.git
  • 相关阅读:
    根据包路径输出类列表
    Logback配置
    接口的幂等性
    mock获取入参数并动态设置返回值
    linux,日志查找技巧
    scrapy 一些坑
    Pyinstaller打包附带DLL、图标和压缩EXE方法
    scrapy 爬虫教程
    买房
    Python: 在CSV文件中写入中文字符
  • 原文地址:https://www.cnblogs.com/litmmp/p/5221505.html
Copyright © 2011-2022 走看看