自己搭建git 代码服务器
Posted app
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自己搭建git 代码服务器相关的知识,希望对你有一定的参考价值。
使用git服务器的工程师都需要生成一个ssh的公钥
The authenticity of host ‘localhost (::1)‘ can‘t be established.
RSA key fingerprint is eb:e3:e2:36:84:64:23:f2:b8:7b:a0:4c:ef:d4:9e:7d.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
执行一下:$ssh localhost -o StrictHostKeyChecking=no
(用ssh登录一下就好使,就不会弹出The authenticity of host ‘localhost (::1)‘ can‘t be established.的错误了。)
然后再退出ssh登录。
然后:
[email protected]:~/linux-2.6$ git push origin master
Counting objects: 56913, done.
Compressing objects: 100% (56081/56081), done.
Writing objects: 100% (56913/56913), 150.96 MiB | 4.08 MiB/s, done.
Total 56913 (delta 4433), reused 0 (delta 0)
To [email protected]:/home/git/work/project.git
* [new branch] master -> master
[email protected]:~/linux-2.6$ ls
就好了。
小组内开发者b下载代码时:
[email protected]:~$ git clone [email protected]:/home/git/work/project.git
Initialized empty Git repository in /home/b/project/.git/
The authenticity of host ‘localhost (::1)‘ can‘t be established.
RSA key fingerprint is eb:e3:e2:36:84:64:23:f2:b8:7b:a0:4c:ef:d4:9e:7d.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: The remote end hung up unexpectedly
[email protected]:~$
同样执行一下:
[email protected]:~$ ssh localhost -o StrictHostKeyChecking=no
[email protected]:~$ git clone [email protected]:/home/git/work/project.git
Initialized empty Git repository in /home/b/project/.git/
[email protected]‘s password:
remote: Counting objects: 56913, done.
remote: Compressing objects: 100% (51648/51648), done.
remote: Total 56913 (delta 4433), reused 56913 (delta 4433)
Receiving objects: 100% (56913/56913), 150.96 MiB | 13.48 MiB/s, done.
Resolving deltas: 100% (4433/4433), done.
Checking out files: 100% (53646/53646), done.
[email protected]:~$ ls
examples.desktop project
[email protected]:~$ ls
examples.desktop project
[email protected]:~$
[email protected]:~$
[email protected]:~$ cd project/
[email protected]:~/project$ ls
arch crypto include kernel net security
block Documentation init lib README sound
certs drivers ipc MAINTAINERS REPORTING-BUGS tools
COPYING firmware Kbuild Makefile samples usr
CREDITS fs Kconfig mm scripts virt
分析 ssh localhost -o StrictHostKeyChecking=no可能不会检查公钥的正确性就让登录了。
以上是关于自己搭建git 代码服务器的主要内容,如果未能解决你的问题,请参考以下文章