zoukankan      html  css  js  c++  java
  • (一)在码云上创建仓库,本地仓库与远程仓库关联

    1、登录码云账号,选择新建仓库(我创建了master/develop1.0分支,其中develop1.0是常规分支,开发者都可以拉取和推送,master是保护分支,仅管理员可推送合并)

    2、windows,下载git安装包,一键安装教程官网下载(需要FQ),国内下载网址1国内下载网址2

    3、安装好git之后,新建一个文件夹,用于放置从仓库克隆下来的项目;右键选择git bash【注:目录路径最好不含中文】

     

     4、设置自己的用户名邮箱,查看设置

    1 $ git config --global user.name "Your Name"
    2 $ git config --global user.email "email@example.com"
    3
    $ git config --list
    
    

    5、秘钥

    生成秘钥,与码云上的秘钥产生关联,一直回车

    ssh-keygen -t rsa -C "xxx@qq.com"

    查看公钥

    cat ~/.ssh/id_rsa.pub

    添加公钥至码云

    测试连接,当终端提示welcome to Gitee.com,yourname!表示链接成功

    ssh -T git@gitee.com

    我因内部网络拦截原因,出现ssh无法连接成功的情况,所以之后的连接通过https,不通过ssh:

    kex_exchange_identification: read: Connection reset by peer

    6、初始化仓库,关联仓库,拉取/克隆仓库

    1、初始化
    git init
    
    2、关联远程仓库
    ssh方式:
    git remote add origin git@gitee.com:xxxxx/xxxx.git
    因ssh端口22被拦截,我选择https方式
    git remote add origin https://gitee.com/xxx/xxx.git

    取消本地目录下关联的远程库:git remote remove origin
    3、查看关联仓库和权限 git remote -v
    4、拉取 
    git pull
    git pull
    <remote> <branch>

    5、查看当前分支和文件情况 git status
    6、查看和切换分支
    查看本地分支 git branch
    查看远程分支 git branch -r
    切换分支 git checkout develop1.0
    克隆项目
    git clone git@gitee.com:xxxxx/xxxx.git

    链接从项目进行复制

  • 相关阅读:
    Understanding about Baire Category Theorem
    Isometric embedding of metric space
    Convergence theorems for measurable functions
    Mindmap for "Principles of boundary element methods"
    Various formulations of Maxwell equations
    Existence and uniqueness theorems for variational problems
    Kernels and image sets for an operator and its dual
    [loj6498]农民
    [luogu3781]切树游戏
    [atAGC051B]Three Coins
  • 原文地址:https://www.cnblogs.com/cyanlee/p/11849228.html
Copyright © 2011-2022 走看看