mirror of
https://github.com/oldratlee/translations.git
synced 2026-04-14 02:00:08 +08:00
@@ -41,8 +41,8 @@
|
||||
|
||||
### 功能分支
|
||||
|
||||
每个新功能位于一个自己的分支,这样可以[`push`到中央仓库以备份和协作](https://www.atlassian.com/git/tutorial/remote-repositories#!push)。
|
||||
但功能分支不是从`master`分支上拉出新分支,而是使用`develop`分支作为父分支。当新功能完成时,[合并回`develop`分支](https://www.atlassian.com/git/tutorial/git-branches#!merge)。
|
||||
每个新功能位于一个自己的分支,这样可以[`push`到中央仓库以备份和协作](https://www.atlassian.com/git/tutorials/syncing#git-push)。
|
||||
但功能分支不是从`master`分支上拉出新分支,而是使用`develop`分支作为父分支。当新功能完成时,[合并回`develop`分支](https://www.atlassian.com/git/tutorials/git-merge)。
|
||||
新功能提交应该从不直接与`master`分支交互。
|
||||
|
||||

|
||||
@@ -89,14 +89,14 @@
|
||||
|
||||

|
||||
|
||||
第一步为`master`分支配套一个`develop`分支。简单来做可以[本地创建一个空的`develop`分支](https://www.atlassian.com/git/tutorial/git-branches#!branch),`push`到服务器上:
|
||||
第一步为`master`分支配套一个`develop`分支。简单来做可以[本地创建一个空的`develop`分支](https://www.atlassian.com/git/tutorials/using-branches#git-branch),`push`到服务器上:
|
||||
|
||||
```bash
|
||||
git branch develop
|
||||
git push -u origin develop
|
||||
```
|
||||
|
||||
以后这个分支将会包含了项目的全部历史,而`master`分支将只包含了部分历史。其它开发者这时应该[克隆中央仓库](https://www.atlassian.com/git/tutorial/git-basics#!clone),建好`develop`分支的跟踪分支:
|
||||
以后这个分支将会包含了项目的全部历史,而`master`分支将只包含了部分历史。其它开发者这时应该[克隆中央仓库](https://www.atlassian.com/git/tutorials/setting-up-a-repository#git-clone),建好`develop`分支的跟踪分支:
|
||||
|
||||
```bash
|
||||
git clone ssh://user@host/path/to/repo.git
|
||||
@@ -113,7 +113,7 @@ git checkout -b develop origin/develop
|
||||
|
||||

|
||||
|
||||
这个示例中,小红和小明开始各自的功能开发。他们需要为各自的功能创建相应的分支。新分支不是基于`master`分支,而是应该[基于`develop`分支](https://www.atlassian.com/git/tutorial/git-branches#!checkout):
|
||||
这个示例中,小红和小明开始各自的功能开发。他们需要为各自的功能创建相应的分支。新分支不是基于`master`分支,而是应该[基于`develop`分支](https://www.atlassian.com/git/tutorials/using-branches#git-checkout):
|
||||
|
||||
```bash
|
||||
git checkout -b some-feature develop
|
||||
@@ -208,7 +208,7 @@ git merge issue-#001
|
||||
git push
|
||||
```
|
||||
|
||||
就像发布分支,维护分支中新加这些重要修改需要包含到`develop`分支中,所以小红要执行一个合并操作。然后就可以安全地[删除这个分支](https://www.atlassian.com/git/tutorial/git-branches#!branch)了:
|
||||
就像发布分支,维护分支中新加这些重要修改需要包含到`develop`分支中,所以小红要执行一个合并操作。然后就可以安全地[删除这个分支](https://www.atlassian.com/git/tutorials/using-branches#git-branch)了:
|
||||
|
||||
```bash
|
||||
git checkout develop
|
||||
|
||||
Reference in New Issue
Block a user