- Clone Github Repo
- 建立分支
- 處理分支內容
- 將異動提到暫存區
- 將異動提到本機Repo
- 將分支與異動提到Github Repo
- Clone Github Repo
xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger $ git clone https://github.com/xxx/blogger.git
xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger $ cd blogger xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (master)
進入clone回來的路徑下,自動進入master分支中
- 建立分支
xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (master) $ git checkout -b sqlite Switched to a new branch 'sqlite' xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (sqlite)
- 處理分支內容
建立一個 readme.md 檔案
- 將異動提到暫存區
xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (sqlite) $ git status On branch sqlite Untracked files: (use "git add <file>..." to include in what will be committed) readme.md nothing added to commit but untracked files present (use "git add" to track) xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (sqlite) $ git add . xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (sqlite) $ git status On branch sqlite Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: readme.md
- 將異動提到本機Repo
xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (sqlite) $ git commit -m 'add readme.md' [sqlite f0be20e] add readme.md 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 readme.md
- 將分支與異動提到Github Repo
xxx@LAPTOP-LIGR7CRV MINGW64 /d/test/blogger/blogger (sqlite) $ git push origin sqlite Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Delta compression using up to 8 threads Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 258 bytes | 258.00 KiB/s, done. Total 2 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), completed with 1 local object. remote: remote: Create a pull request for 'sqlite' on GitHub by visiting: remote: https://github.com/xxx/blogger/pull/new/sqlite remote: To https://github.com/xxx/blogger.git * [new branch] sqlite -> sqlite