git:上傳、下載、新增、刪除檔案到遠端倉庫
阿新 • • 發佈:2019-01-02
一、下載倉庫檔案:
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 :提交更新