[英]Pushing feature branch to remote repository to merge with not in sync master
In the company I work for, the developer is pushing the local feature branch after changes locally committed, to the remote repository.在我工作的公司中,开发人员在本地提交更改后将本地功能分支推送到远程存储库。 Then after the code review, the feature branch is merged into master (the remote master).
然后经过代码审查,将特性分支合并到master(远程master)中。
My question is:我的问题是:
What if the local master and the remote master not in sync?如果本地master和远程master不同步怎么办? Then the branch is merged into a completely different project?
然后分支合并成一个完全不同的项目? For example, I git cloned master 2 weeks ago + branched from it to a new feature branch, but in these two weeks, changes have been made to the master.
比如我 git cloned master 2 周前 + 从它分支到一个新的特性分支,但是这两个星期,对 master 做了改动。 So my worry is that my feature branch will be merged into totally different master branch!
所以我担心我的功能分支会被合并到完全不同的主分支! Without me testing it first.
没有我先测试。
Question: isn't a smarter workflow would be to before pushing the feature branch to remote repository and pull request to first:问题:在将功能分支推送到远程存储库并首先拉取请求之前,不是一个更智能的工作流程:
git checkout master
git pull
git checkout my-feature-branch
git merge master (now i know my branch is in sync with master. Resolve conflicts locally)
and only then:只有这样:
git checkout my-feature-branch
git push origin my-feature-branch?
The flow I've seen being employed in several companies (successfully) is as follows:我在几家公司(成功)中看到的流程如下:
References:参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.