当您创建一个存储库,默认情况下它的一个分支的名字的主人。你可以继续工作这个分支和只有一个,很好。但是如果你有另一个特点或想法你想工作,您可以创建另一个分支,从主人开始,这样你就可以离开主人的工作状态。当你创建一个分支,复制原始的分支是在那个时间点(如照片快照)。如果原始分支变化当你在你的新分支,不用担心,你可以把这些更新。
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.