1. 在本地需要提交的文件同級目錄運行git bash
2. 初始化 git 運行環境
$ git init
3. 新建本地分支develop
$ git checkout -b decelop
4. 鏈接遠程倉庫
$ git remote add origin remote_address
5. 同步遠程倉庫信息
$ git pull
6. 關聯本地倉庫與遠程倉庫
$ git branch --set-upstream-to=origin/develop develop
7. 若遇報錯: branch 'develop' does not exist
則運行如下指令:
$ git pull origin branch --allow-unrelated-histories
$ git branch --set-upstream-to=origin/develop develop
8. 查看當前分支跟蹤的遠程分支
$ git branch -vv
9. 同步遠程分支
$ git pull
10. 提交修改到遠程分支
$ git add . $ git commit -m "modify description" $ git push