[英]What I should do when using Gitflow Workflow and the master progress?
I've read about Gitflow Workflow here and they say to create a develop branch from master and a feature branch from develop . 我在这里阅读了有关Gitflow工作流的信息 ,他们说要从master创建一个develop分支,并从develop创建一个feature分支。 So I forked a repo and I created a branch develop having the latest commit on master (C1) as parent, then I created two features branches from develop branch where I'm working. 因此,我分叉了一个仓库,并创建了一个分支开发 ,该分支开发具有对母版 (C1)的最新提交作为父级,然后从我工作的开发分支中创建了两个功能分支。 Now master has new commits but my develop branch and features branches are still based on the older commit(C1). 现在master有了新的提交,但是我的develop分支和features分支仍然基于旧的commit(C1)。
There is a way to integrate changes as master progress, like changing where is pointing the develop branch? 有一种方法可以将更改作为主要进度进行集成,例如更改指向开发分支的位置? Maybe using rebase but I don't know how to apply to my case. 也许使用rebase,但我不知道如何适用于我的案子。 develop and features branches are local. 发展和特色分支机构是本地的。
In few words how to work on a feature and constantly integrate the progress from master? 简而言之,该如何处理某个功能并不断整合大师的进度?
To keep your branches in sync with master
you basically will need to this: 为了使您的分支与master
保持同步,您基本上需要这样做:
First, change to master branch and get the changes: 首先,更改为master分支并获取更改:
git checkout master
git pull
Then change to your branch and put it in sync with master
: 然后转到您的分支,并使其与master
同步:
git checkout your-branch
git merge master
Depending on what you are working on it may create some conflicts while merging the ones you will have to solve. 根据您要处理的内容,在合并您必须解决的冲突时可能会产生一些冲突。
In case you don't want to update first your local master branch you can update directly your local branch with the <remote>/master
by doing this: 如果您不想首先更新本地master分支,则可以通过<remote>/master
直接更新本地分支,方法是:
git checkout your-branch
git rebase origin/master
You could also push directly from your branch to master: 您也可以直接从分支机构推送到主服务器:
git push origin HEAD:master
But will not play nice with the gitflow, better push to develop
, etc. 但是不能与gitflow配合使用,更好地推动develop
等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.