Git入门

2019-10-30  本文已影响0人  易点梅

0、安装Git Bash

http://msysgit.github.io/

1、获取密钥

$ ssh-keygen-t rsa-C "your_email@youremail.com"

之后需要输入路径和密码,直接回车默认即可

2、回到GitHub,Settings,SSH and GPG Keys,新建SSH key,保存生成的密钥

3、验证是否成功

$ ssh -T git@github.com

4、设置username和email

$ git config --global user.name "your name"

$ git config --global user.email "your_email@youremail.com"

5、将github上的某个库克隆到本地电脑,定位git bash到某个文件夹下

$ cd xxx\ yyy\ rrr/

$ git clone https://github.com/yourname/Hello-Word

6、将本地库中的文件上传到GitHub

$ git add test.txt

$ git commit -m "备注,可有可无"

$ git push origin master

7、设置Git Bash的启动时所在文件夹

上一篇 下一篇

猜你喜欢

热点阅读