5、测试
[root@localhost ~]# yum install git
........
[root@localhost ~]# ssh -T git@github.com
The authenticity of host 'github.com (13.250.177.223)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,13.250.177.223' (RSA) to the list of known hosts.
Hi meteor! You've successfully authenticated, but GitHub does not provide shell access.
[root@localhost ~]#
8、连接远程仓库听方法(创建一个测试存储库)
# 在github网站新建一个仓库,命名为linux
~~~
cd /opt
mkdir linux
cd linux
~~~
# git初始化,然后做第一个基本的git操作(需要在github上创建存储库)
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:userhub/linux.git
~~~
# 若出现origin已经存在的错误,删除origin
[root@jinch2 linux]# git remote rm origin
# 现在继续执行push到远端
~~~
[root@jinch2 linux]# git remote add origin git@github.com:userhub/linux.git
[root@jinch2 linux]# git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 205 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:fakehydra/linux-.git
* [new branch] master -> master
分支 master 设置为跟踪来自 origin 的远程分支 master。
# 注意
# 设置存储库链接
git remote set-url origin git@github.com:userhub/linux.git
# 如果push失败,合并分支到 master 再push
git pull --rebase origin master
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。