因為之前處理 scrum-1 pull requests 的合併, 直接在 github 網站上執行, 只是 scrum-1 所提交的版本為近端網誌版本, 因此這裡必須 git pull 後, 進行改版, 並且檢查無誤後, 改提交遠端版本.

直接合併

首先在近端新增目前這篇網誌 .md 檔案, 利用 local-pelican 與 https-server 在近端檢查網誌內容.

檢查無誤後, 利用 gh-pages-pelican 按鈕轉為遠端網誌格式之後, 提交推送.

無法直接合併

當 scrum-1 所送出的 pull requests 無法直接在線上合併時, github 建議:

git checkout -b scrum-1-gh-pages gh-pages

git pull https://github.com/scrum-1/project_site.git gh-pages

表示要將目前倉儲中的 gh-pages 簽出到 scrum-1-gh-pages 分支後, 拉回 scrum-1 目前的版本.

接著則改版目前這篇網誌內容, 並且利用近端 local-pelican 按鈕轉檔後檢視.

確定沒有問題之後, 改用 gh-pages-pelican 按鈕轉為遠端格式.

至於版本的提交推送, github 建議:

git checkout gh-pages

git merge --no-ff scrum-1-gh-pages

git push origin gh-pages

表示要將近端倉儲的分支簽回 gh-pages, 然後合併 scrum-1-gh-pages 分支, 且以 no fast-forward 的方式進行合併. 最後再將近端 gh-pages 分支版本提交推送到遠端.

但是當我們操作 git merge --no-ff scrum-1-gh-pages 指令時, git 無法自動合併許多有差異的 html 檔案, 這時就必須再利用近端與遠端轉檔按鈕進行內容轉檔與查驗之後, 就可以:

git add -A

git commit -m "try to add all changes on scrum-1-gh-pages branch"

請注意, 這時的分支仍位於 scrum-1-gh-pages, 之後再執行:

git checkout gh-pages

git merge --no-ff scrum-1-gh-pages

表示要簽出 gh-pages 分支版本, 然後與 scrum-1-gh-pages 分支版本進行 no fast-forward 合併.

完成後, 再進行最後的近端轉檔查驗, 以及遠端的轉檔後, 就可將 gh-pages 分支版本提交推送.


Comments

comments powered by Disqus