git上传文件到远程仓库

时间:2024-11-18 18:42:57

git上传项目到远程仓库

1. 生成SSH公钥(ssh-keygen),一直回车即可在这里插入图片描述

2. 将公钥复制下来,粘贴至码云仓库

公钥默认地址: C:\Users\Administrator\.ssh

[外链图片转存失败(img-c9VKo8Jj-1568995363386)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568994474838.png)]

[外链图片转存失败(img-rRcNeyMa-1568995363387)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568994576884.png)]

3. 克隆项目到本地(复制SSH地址)

[外链图片转存失败(img-DNlDUMnX-1568995363388)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568994704326.png)]

[外链图片转存失败(img-RdaUOjBF-1568995363388)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568994765637.png)]

4. 上传文件到刚创建的项目(这里取名为test.py)

[外链图片转存失败(img-sHiwTPeS-1568995363389)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568994862824.png)]

5. 上传需要做的几个步骤

(1) git add .  添加所有文件到缓冲区
(2) git commit -m "tset文件"  添加至本地仓库
(3) git push
(4) 这样就添加成功了,是不是很简单,自己去试一试吧!!

[外链图片转存失败(img-e3xOJx1B-1568995363390)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568995010846.png)]

[外链图片转存失败(img-1wwvEHBY-1568995363391)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1568994991830.png)]