使用gitBash连接git并上传文件
1.准备
在连接之前我们需要的资源:
-
1.拥有一个github账户 https://github.com/join
-
2.安装git 下载地址 https://github.com/waylau/git-for-win/
2.设置git
- 打开gitbash
- 设置姓名
$ git config --global user.name "github账号名"
$ git config --global user.email "github邮箱”
3.设置SSH Key
GitHub上连接已有仓库时的认证,是通过使用了SSH的公开密钥认证方式进行的。现在让我们来创建公开密钥认证所需的 SSH Key,并 将其添加至 GitHub。
$ ssh-keygen -t rsa -C "github邮箱"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa): 按回车键
Enter passphrase (empty for no passphrase): 输入密码
Enter same passphrase again: 再次输入密码
“
如果出现一下结果就是成功了
Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa. Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub. The key fingerprint is:
fingerprint值 your_email@example.com
The key's randomart image is:
<