第一次写文章,想把自己学习的过程记录下来,希望能和大家分享
一.注册github(不再多说)
![](https://img.haomeiwen.com/i6100160/daeaad726fd0e1db.png)
二.创建自己的Repository
![](https://img.haomeiwen.com/i6100160/e093544167c6af20.png)
![](https://img.haomeiwen.com/i6100160/a6f61a6c58b82843.png)
三.建立git
1)cd 本地项目地址
2)git init(注意:出现以下问题,需要先进行身份验证)
![](https://img.haomeiwen.com/i6100160/4d5fb04f6605e8f4.png)
验证方法:
1.cd ~/.ssh
2.ssh-keygen -t rsa -C "注册邮箱"
回车(不用设置密码)
3.找到图1.5上面括号中地址的文件,下图(1.5),打开后复制内容
![](https://img.haomeiwen.com/i6100160/2680c0b6094dfca7.png)
登陆github进行如下操作
![](https://img.haomeiwen.com/i6100160/180fc4764f01dcf5.png)
![](https://img.haomeiwen.com/i6100160/aede7749cdac26ee.png)
终端中需要配置账户和邮箱
git config --global user.name "账户"
git config --global user.email "邮箱"
再进行1)2)操作将会返回如下信息
![](https://img.haomeiwen.com/i6100160/a0cf8ba93d61bb4b.png)
3)git add .(图1.9)
4)git commit -m "提交的信息"
![](https://img.haomeiwen.com/i6100160/69204be872f828ad.png)
5)git remote add 名字 地址(图2.1)
ps:名字可取项目名称/地址如下(创建的repository)
![](https://img.haomeiwen.com/i6100160/925657b3ff655835.png)
![](https://img.haomeiwen.com/i6100160/05db9ae0f5d157d3.png)
6)git pull 名字 master(图2.2)
7)git push -u 名字 master(图2.3)
![](https://img.haomeiwen.com/i6100160/f508c408b076aea0.png)
![](https://img.haomeiwen.com/i6100160/c9379073fa9f4dc9.png)
执行完没有异常则代表上传成功了
如果有问题可以给我留言,希望文章能给大家一点帮助
网友评论