美文网首页
git 本地仓库与远程仓库关联

git 本地仓库与远程仓库关联

作者: zcxzcxczcx | 来源:发表于2021-03-15 23:27 被阅读0次

    1、git config

    https://www.cnblogs.com/fireporsche/p/9359130.html

    2、git本地仓库与远程仓库关联,有两种方式

    > cd 进入仓库目录

    >git init

    关联可以通过https协议,也可以通过ssh协议,如下:

    a、https协议

    git remote rm origin    //先删除以防其他的远程链接占用

    git remote add origin https://username:password@github.com/username/nihao.git

    输入用户名和密码

    b、ssh协议

    要先在本地生成公私钥,然后把公钥配置在github远程仓库:https://www.cnblogs.com/tinyphp/p/5025311.html

    git remote add origin git@github.com:nanfei9330/learngit.git

    相关文章

      网友评论

          本文标题:git 本地仓库与远程仓库关联

          本文链接:https://www.haomeiwen.com/subject/enolcltx.html