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、发布: