Questions tagged [branching-and-merging]

In version control, branches represent parallel lines of development. Merging is the action that integrates changes made in different branches.

Modern version control systems (VCS) handle branching and merging by keeping track of incremental differences in data. When a user creates a branch of a project and begins making edits to that branch, only the edits made are tracked (as opposed to the user editing a true copy of the project). When the user have finished making changes to the branch, these edits are applied in order onto the destination of the merge, branches to be made and merged at any time.

Conflicts may arise if multiple changes are made to the same data in a project. Modern VCSs will alert the user and ask them to resolve the merge conflicts (choose which changes should be kept) before completing the merge.

1503 questions
31
votes
1 answer

How should Git Flow work with QA testing both a release and a new feature?

We are using Git Flow on our latest iOS project and I am trying to work out a way of working with QA so that they can test the latest release, as well as testing a new feature, without having to worry about which bugs were fixed in which branch. At…
jowie
  • 8,028
  • 8
  • 55
  • 94
31
votes
3 answers

What are the consequences of renaming a branch in TFS 2012?

I've read in many places that renaming a branch is rather problematic in TFS 2010 : you may lose the history of the branch you just renamed ( as seen in this article or in this SO question ) I cannot find any mention of those problems in TFS 2012.…
tsimbalar
  • 5,790
  • 6
  • 37
  • 61
30
votes
2 answers

Merging Mercurial branches from separate repositories

I'm trying to figure out how to merge branches from a separate repo into the current. I have the following: PJT1 - contains branches default and foodog PJT2 - contains branch default from PJT2, I do the following: $ hg fetch -y ../PJT1 -r foodog -m…
KingFish
  • 8,773
  • 12
  • 53
  • 81
28
votes
3 answers

Show only history of one branch in a Git log

I am using Git for my project and trying to follow best practice: I work on a topic branch When ready, I merge the topic branch into my dev branch using git merge --squash. This keeps my dev branch clean. Whenever the dev branch is stable and the…
Alex Recarey
  • 20,178
  • 4
  • 25
  • 22
28
votes
1 answer

Handling changes to files with --skip-worktree from another branch

On my machine, I've set --skip-worktree to config/database.yml. git update-index --skip-worktree config/database.yml Another developer has committed and merged into the develop branch changes to config/database.yml while working on the…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
27
votes
4 answers

Git merging hotfix to multiple branches

I've been trying to wrap my head around git branching models. I've been looking at http://nvie.com/posts/a-successful-git-branching-model/ for some ideas and coming from Subversion one thing I was really looking forward to was making a change in a…
Chuck M
  • 1,175
  • 3
  • 17
  • 26
26
votes
5 answers

Branch by feature - Advantages/disadvantages?

I'm currently working in a project where branching and merging haven't been working very well at all from the start. In order to change this, we've been talking about loads of different ways to do it. I assume everyone have there own philosophy…
MrW
  • 1,210
  • 2
  • 16
  • 27
26
votes
5 answers

TFS 2010 Branch Across Team Projects - Best Practices

I'm having issues understanding how to configure TFS according to best practices as provided by the TFS Ranger team. The issue is such: My company has several products which make use of a shared common code base. > $/Core > -> /Main/Source (Parent…
Daniel
  • 1,843
  • 2
  • 18
  • 27
26
votes
1 answer

Git - Same file with different versions on two branches, when merge do not want to overwrite

We have two branches -- 'master' and 'release' And we have one file, like fileA, we want to keep different version on these two branches. But each time, we have to merge 'release' into 'master', how can we achieve, the fileA in 'master' will not be…
LongYang0806
  • 835
  • 1
  • 8
  • 9
25
votes
4 answers

Override author on git merge

Is there an option like --author of git-commit for git-merge? We maintain a staging environment where some changes must be performed. Some limitations make us to use only one linux user to access staging environment. Anyway, we are a small team with…
25
votes
3 answers

Mercurial: Create a branch without having to make a change first

I heard that the only way to create a branch in a Mercurial repository is to make changes in the working copy, then commit them to a new branch. In Subversion, I can create a branch without having to make changes (by copying trunk to a path under…
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
24
votes
3 answers

How can I use git for projects templates?

I have some template/starting point code that I reuse across projects. While working on the new project, I always want to add and change things in the template. Develop the template alongside the project, I guess. Some of my additions are…
Joel
  • 283
  • 2
  • 6
24
votes
3 answers

Folder converted to branch?

In TFS (We are using 2012) why is the default to convert your source folder to a branch? I really don't consider the source a branch. What, if any, advantages/disadvantages does this have?
coding4fun
  • 8,038
  • 13
  • 58
  • 85
23
votes
7 answers

Find the latest merge point of two branches

Having two branches, how can I find the latest revision(s) where the two branches were merged? Is there a standard Mercurial command to do that? This is the same as question How to find the common ancestor of two branches in SVN?, but for Mercurial…
daniel kullmann
  • 13,653
  • 8
  • 51
  • 67
20
votes
2 answers

SVN branching with local modifications

I've been doing some minor fixes on the trunk, but I am wishing I would have branched out for what I'm doing now. What's the easiest way to do this in Tortoise SVN now? I'm thinking that this is what the "Working Copy" option is for when branching,…
Brandon Moore
  • 8,590
  • 15
  • 65
  • 120