首页 > 学院 > 开发设计 > 正文

初始化github

2019-11-06 09:15:55
字体:
来源:转载
供稿:网友

1.安装Git,使用命令 “sudo apt-get install git”

我的已经安好了,就不用安装了

生成key 生成ssh key,使用命令 “ssh-keygen -t rsa -C “your_email@youremail.com””,your_email是在github上注册用的email

2.检查key是不是已经存在, 打开一个终端,并输入以下命令: $ ls -al ~/.ssh 如果结果列表中包含以下文件, 则不需要在生成新的KEY, 可以直接使用。 id_dsa.pub id_ecdsa.pub id_ed25519.pub id_rsa.pub

检查后是存在的

3.Ensure the ssh-agent is running: **后台开启**ssh-agent

eval $(ssh-agent -s)

Agent pid 59566

4.Add your SSH key to the ssh-agent.

$ ssh-add ~/.ssh/id_rsa

5.Copy the SSH key to your clipboard. 如果没有clip则需要安装 程序“clip”尚未安装。 您可以使用以下命令安装: sudo apt-get install geomview

6.获取id_rsa.pub cd .ssh/

ls

打开ssh key more id_rsa.pub

7.看是否添加成功 mary@administrator-ThinkStation-P710:~$ ssh -T git@github.com The authenticity of host ‘github.com (192.30.253.112)’ can’t be established. Are you sure you want to continue connecting (yes/no)?

选择yes yes Warning: Permanently added ‘github.com,192.30.253.112’ (RSA) to the list of known hosts.

添加成功 Hi 某某! You’ve successfully authenticated, but GitHub does not PRovide shell access.

开始上传文件

新建文件readme

$ git add readme$ git commit -m "first commit"$ git push origin master

参考资料


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表