共同開發一個專案的小筆記- branch 與 PR
upstream:master <- clone:master is very confusing. In addition, it makes it hard for reviewers to pull your “branch” (actually the master!) to their local.
貢獻一個專案需要注意要用feature branch而不要用master branch發PR,用master branch 發PR會造成專案擁有者的混淆。
並且,在編修完一個issue之後,建議的作法是將feature branch刪除。貢獻一個專案的流程可以參考以下流程:
- Fork 屬於solvcon的專案modmesh。
- 創建feature branch並在上面做編修。
- 用這個feature branch發PR。
- 把此feature branch 合併回master。
- 刪除feature branch。
- 進一步sync專案A。
i.e,
solvon/modesh -> EN/modmesh
git checkout feature1
solvcon:master <- EN:feature1
git checkout master && git merge feature1
git branch -d feature1
and delete the branch on github.- “Sync fork”.
git graph
vscode中的 git graph 可以視覺化git,可以讓開發的進展更一目了然,減少出錯的機會,同時也可以加快熟悉git的腳步。
A starting point for git command
- git init
- git clone
- git add
- git commit
- git push
- git pull