【GIT】Git常用指令
初始化
Git init
(在本地工程目錄下),生成.git 資料夾,如果已經生成過就不需要初始化了
Git init
提交檔案
git add *
(可替換成具體要上傳的檔名, 表示提交所有有變化的檔案)
新增上傳檔案的描述
git commit -m "本次提交描述"
建立分支
git branch test
切換分支
git checkout test
與遠端分支相關聯
git remote add origin https://github.com/stormsha/blog.git
上傳分支
git push origin test
常用命令
- git remote add origin https://github.com/stormsha/blog.git (關聯遠端倉庫)
- git add . (提交檔案)
- git commit -m "test" (提交描述)
- git branch test(建立分支)
- git checkout test (切換分支)
- git push origin test (上傳檔案)
- git pull --rebase origin master(合併遠端倉庫)