Git 添加远程库到 github

1、github 上 new repository 。
2、git 下进入 项目目录。
3、添加远程库:

$ git remote add origin git@github.com:anyao/dvmng3.git

4、将程序推送到库上( master 上) 。

$ git push -u origin master

5、成功:
这里写图片描述

P.S. 如果遇到问题:

状况一: $ fatal: unable to access 'https://github.com/anyao/dvmng3.git/': Unknown SSL protocol error in connection to github.com:443
解决方法:$ git config --global --add http.sslVersion tlsv.1.0

状况二:$ ssh: connect to host github.com port 22: Connection timed out. fatal: Could not read from remote repository.
解决方法:
$ git config --local -e
② 修改其中 url 。由 url = git@github.com:anyao/dvmng3.git 改为 url = https://github.com/anyao/dvmng3.git
原因:网络(墙?)禁用了SSH的22端口导致的。所幸git提供了https、git、ssh三种协议来读写。

P.P.S. readme.md 上传仓库里的图片:

![](https://github.com/anyao/dvmng3/img/1.png)  

P.P.S. github 客户端添加:
1、添加新的远程库
这里写图片描述
2、发布:
这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值