git:上传、下载、添加、删除文件到远程仓库

一、下载仓库文件:

1、设置你要从哪个仓库上传/下载文件

git remote add origin [email protected]:ssh159/ssh159.github.io

git remote -v :查看当前的仓库地址!

2、把远程仓库的文件下载到本地

git clone https://github.com/ssh159/ssh159.github.io

二、上传/添加文件到仓库:

1、git add +文件夹 :上传文件夹

git add jquery.js

git add .  :上传当前目录全部文件

2、git commit -m "说明文件":缓存到本地仓库,做一个说明

git commit -m "jquery脚本"



3、git commit -v :查看上传的信息反馈:

4、git push :上传文件

三、删除远程仓库文件:

1、git rm -r --cached (你要删除的文件)     (这里只是删除本地文件)

git rm -r --cached index.jsp :删除index.jsp文件,也可以删除整个文件夹!



2、git commit -m "说明"    (向远程仓库发送,也删除远程仓库的文件)

3、git push :提交更新





猜你喜欢

转载自blog.csdn.net/ssh159/article/details/78981687