English 中文(简体)
1. 采用合并发展事务组/重新并入一个稳定事务组,加之
原标题:Reusing a merged development branch / Remerging into an unchanged stable branch with git

两名方案人员,A &B,正在办理一个有色布的东道邮袋的项目:

Branch master exists.

方案管理员 A. 根据最新的主人创建和发展银行

master$ git checkout -b devBranchA

方案管理员 B 根据最新的主人创建发展银行

master$ git checkout -b devBranchB

They decide to merge stable changes into master whenever possible.

The agreed workflow is:

[关于Bdevranch]

git commit -m  Stuff to make branch stable enough to merge 

git checkout master

git pull origin master 

git merge devBranch [fix merge conflicts if any]

git checkout devBranch

git commit -m  New cool stuff 

然而,如果自上次合并以来没有任何主人的承诺,那么就不可能把dev子重新并入主人(除非设立了一个新的发展分支,而不是旧的再利用)。

在此情况下,当Pr B将其工作并入总务时,它不是目前的主人,而是合并前的主人。

如果没有临时承诺,能否自动迫使总务局向发展事务处处长通报合并情况?

打算由多个用户在 g和中央集聚物库工作时的工作流程是什么? 我感觉到,尽管我没有像打算那样使用it。

问题回答

Check out git fetch;git rebase origin/master or git pull --rebase, both honor the order of the commits in the master repository because it rebases, sticking local commits on top. You don t care about the order of the local commits as much on local branches anyway because only you have them. Try it out, but use with care, e.g. duplicate a branch before rebasing until you re used to it.

总的来说,你再次谈论了香味工作流程,我发现,你应该熟悉两个一般性的工作流程。 了解我从个人经验中谈论如何尽量减少冲突:

  • Rebase-first workflow (for cleanest commit history, pushes the burden of conflicts generally to uncommitted code)
  • Merge workflow (sometimes simpler when there are a lot of changes that would conflict, I usually use this only as a fallback)

Example Initial workflow

git checkout master // For the sake of argument, let s say the latest commit in your local master is from august 1st or something old like that.
git branch temp_branch // copy of the master
git checkout temp_branch
git add changedFiles;git commit changedFiles; // A change from november 2nd.

git log // Now your dev branch has a new commit on top of an otherwise old branch.

git log origin/master // You get a listing of the commits from the origin repository, the master branch.  

Generally I use origin/master for development staging, with git tags standing for the commits that are made live releases.

Now here s where the problem occurs, and where the choice of workflow comes into play: let s say there s a commit that came from another dev repository up in master, e.g. a commit from october 15th. Maybe it was commited by another developer, maybe by yourself.

你的选择: 合并或重新计算。

Merge

作出额外承诺,为你们的当地(不尽人意)在神学(原产/主)历史中分立的发展中世界历史,给他人和其他分支带来更大的冲突潜力。 基本上,你说,“我的意志与总务局混淆”,而不是重订历史。

git merge origin/master // merge commit introduced
... // Resolve any conflicts, and finalize the merge commit.
git checkout master;git rebase temp_branch // Move the changes to master.
git push origin/master // Pushing changes, including merge commit, to origin/master

最后,承诺的历史将看一看:8月-10月-11月-摩尔格社区

Rebase

当地没有承诺,在运河存放处(原产地/主)已经承诺支付酬金,通常会发生冲突,因为开发商尚未作出承诺(因此,别无一人可以负责)。

git rebase origin/master // 
... // Resolve any conflicts...
git rebase --continue or git rebase --abort
... // Resolve any conflicts...
git checkout master;git rebase temp_branch // Get the branch changes without a merge commit into master.
git push // Push all changes to the canonical repository.

注:如果你最终不得不做两个以上的冲突决议——当时是<代码>git rebase——abort<>/code>的良好时机,并回到一起。


了解这一进程,看看它是否对你有用! 在你能够真正掌握有助于你发展的策略之前,我进行一些试验,因为一旦你权力下放,就有更多的办法。

您可以找到另一个实例,说明

如“所述。 右翼工作流程与共有的特质分支是什么?,我宁愿避免“后合”(从<条码>到<条码>>>,而是在<条码>/条码>上重订“条码>。

  • devBranch is regularly merged to master
  • I rebase only new local commits (that I haven t pushed yet).




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签