简体   繁体   English

使用Gitflow工作流程和主进度时我应该怎么做?

[英]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.

相关问题 Gitflow 工作流与 Maven - 何时构建什么? - Gitflow Workflow with Maven - when to build what? Gitflow:从发布分支合并到主分支时,我应该压缩提交吗? - Gitflow: Should I squash commits when merging from a release branch into master? 将其合并回gitflow的master后,是否应该删除开发分支? - Should I delete the development branch after merging it back into the master in gitflow? GitFlow工作流程中是否允许直接提交到master分支? - Is direct commit to master branch allowed in GitFlow workflow? gitflow 工作流程的正确分步命令是什么? - What are the correct step by step commands for gitflow workflow? 在Git中,当推送master分支时,来自开发分支的提交也被推送。 这应该发生吗? 我正在使用Gitflow - In Git when pushing the master branch, commits from the development branch are pushed too. Is this supposed to happen? I am using Gitflow GitFlow:发布分支和主分支有什么区别? - GitFlow: what is difference between release and master branches? gitflow为什么我们需要掌握 - gitflow why do we need master 我应该使用什么工作流程进行并行功能开发? 每个特性都必须单独合并到 master 中 - What workflow should I use for parallel feature development? Each feature must be merged into master on its own 如何在 AzureDevOps 存储库中使用 master 和 develop 上的 PR 分支策略实现/设置 GitFlow? - How do I achieve/setup GitFlow in AzureDevOps repos with PR branch policies on master and develop?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM