當您創建一個存儲庫,默認情況下它的一個分支的名字的主人。你可以繼續工作這個分支和只有一個,很好。但是如果你有另一個特點或想法你想工作,您可以創建另一個分支,從主人開始,這樣你就可以離開主人的工作狀態。當你創建一個分支,複製原始的分支是在那個時間點(如照片快照)。如果原始分支變化當你在你的新分支,不用擔心,你可以把這些更新。
At GitHub, our developers,
writers, and designers use branches for keeping bug fixes and feature work separate from our master
(production)
branch. When a feature or fix is ready, the branch is merged into master
.
To create a new branch
- Go to your new repository
hello-world
. - Click the drop down at the top of the file list that says branch: master.
- Type a branch name,
readme-edits
, into the new branch text box. - Select the blue Create branch box or hit “Enter” on your keyboard.