gitHub使用学习教程
https://github.com/ 这是GitHub的官方网站
1、创建账号之后创建库
2、安装Git Bash
git-scm.com 首先进入GitHub官网,下载适合自己电脑的版本
安装成功即可
3、使用git bash创建ssh key ,使github账号和本机联系起来
获取密钥命令:$ ssh-keygen-t rsa-C "your_email@youremail.com"
确认过程中直接回车即可。
73016@LAPTOP-RBUTTF6N MINGW64 /d/PythonTestcaseGithub (master)
$ ssh-keygen -t rsa -C "15088132074@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/73016/.ssh/id_rsa):
Created directory '/c/Users/73016/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/73016/.ssh/id_rsa.
Your public key has been saved in /c/Users/73016/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:iocpTGMDf4h/CDpEbhDEOonaVHz8AKdn26aCjOILpr4 15088132074@163.com
The key's randomart image is:
+---[RSA 2048]----+
|+. ..o. |
| o oo+ |
|=o ...oo |
|O+.. o o. |
|+BB . . S |
|=O.* + + |
|*.B * + |
|*. o o |
|oEo |
+----[SHA256]-----+
在电脑C:\Users\73016\.ssh 文件中,id_rsa.pub文件中复制该 密钥,登录github网站,在个人设置-SSH 中输入该密钥确认即可
确定是否绑定成功
4、将库下载到本机电脑
73016@LAPTOP-RBUTTF6N MINGW64 /d/PythonTestcaseGithub (master)
$ git clone https://github.com/LinxiBravely/pythonTest.git
Cloning into 'pythonTest'...
warning: You appear to have cloned an empty repository.
5、上传文件到库
73016@LAPTOP-RBUTTF6N MINGW64 /d/PythonTestcaseGithub/pythontest (master)
$ ls
test20180722.txt
73016@LAPTOP-RBUTTF6N MINGW64 /d/PythonTestcaseGithub/pythontest (master)
$ git add test20180722.txt
73016@LAPTOP-RBUTTF6N MINGW64 /d/PythonTestcaseGithub/pythontest (master)
$ git commit -m "2018072201test"
[master (root-commit) 2a71672] 2018072201test
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 test20180722.txt
73016@LAPTOP-RBUTTF6N MINGW64 /d/PythonTestcaseGithub/pythontest (master)
$ git push origin master
fatal: HttpRequestException encountered.
▒▒▒▒▒▒▒▒ʱ▒▒▒▒
Counting objects: 3, done.
Writing objects: 100% (3/3), 223 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/LinxiBravely/pythonTest.git
* [new branch] master -> master
这时代表创建成功