之前搞的都忘了,今天记录一下
首先是在ubuntu上安装git 貌似命令是sudo apt-get install git ,记错了请百度
然后是到远程服务器上申请一个账号,然后开始git clone,很不幸失败了
如下
matt@ubuntu:~/Documents/imx6$ git clone git@git.oschina.net:eric.zhc/imx6.git
Cloning into 'imx6'...
The authenticity of host 'git.oschina.net (218.11.0.86)' can't be established.
ECDSA key fingerprint is 27:e5:d3:f7:2a:9e:eb:6c:93:cd:1f:c1:47:a3:54:b1.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
因为没有key,所以要搞key
关于搞key这边有个链接看看就好http://git.mydoc.io/?t=180845
matt@ubuntu:~/Documents/imx6$ ssh-keygen -t rsa -C "56855106@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/matt/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/matt/.ssh/id_rsa.
Your public key has been saved in /home/matt/.ssh/id_rsa.pub.
The key fingerprint is:
86:b1:76:ec:24:c9:19:ee:d0:b2:07:38:a0:bc:e2:3d 56855106@qq.com
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
|. o |
|o. . + O |
|..o + @ S |
| .. B * |
|.. . o . |
|o .E . |
| . .. |
+-----------------+
这里有个蛋疼的地方是要先到
/.ssh/id_rsa.pub这个目录下去copy 然后贴到网页上
这样才能生成key
最后搞定
matt@ubuntu:~/Documents/linux-3.0.35$ ssh -T git@git.oschina.net
The authenticity of host 'git.oschina.net (218.11.0.86)' can't be established.
ECDSA key fingerprint is 27:e5:d3:f7:2a:9e:eb:6c:93:cd:1f:c1:47:a3:54:b1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'git.oschina.net,218.11.0.86' (ECDSA) to the list of known hosts.
Connection closed by 218.11.0.86
matt@ubuntu:~/Documents/linux-3.0.35$ ssh -T git@git.oschina.net
Welcome to Git@OSC, matthew_xuan!
上传文件么,我的/imx6/目录下有个imx6,把新的文件放到这边,然后git add .
然后git commit就可以了
如果下载谷歌源码失败