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
  • 相关阅读:
    C# get和set
    动手学pytorch-优化算法
    动手学pytorch-梯度下降
    动手学pytorch-凸优化
    动手学pytorch-Batch Norm
    动手学pytorch-经典卷积神经网络模型
    动手学pytorch-卷积神经网络基础
    动手学pytorch-Transformer代码实现
    动手学pytorch-机器翻译
    动手学pytorch-循环神经网络进阶
  • 原文地址:https://www.cnblogs.com/litmmp/p/5221505.html
Copyright © 2011-2022 走看看