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
96
votes
7 answers

Deleting an SVN branch

I created a branch of an SVN project called 'features', and now whenever I try to update said project, it brings with it a features folder, which contains another copy of the project from the branch. Is there a way to remove the branch from the…
GSto
  • 41,512
  • 37
  • 133
  • 184
94
votes
9 answers

git command for making one branch like another

I'm trying to take a branch with changes and bring it back to be identical to the upstream it diverged from. The changes are both local and have been pushed to github, so neither git reset or git rebase are really viable, since they change history,…
Arne Claassen
  • 14,088
  • 5
  • 67
  • 106
89
votes
3 answers

Warning: you are leaving 1 commit behind, not connected to any of your branches

EGit strikes again. I made the mistake of trying to switch to a different branch in EGit and it somehow messed up and checked out no branch. I then made a commit to this non-branch, and then when I realized I wasn't tracking the right branch, I ran…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
69
votes
3 answers

Merge and delete branch in one step/command

Is it possible, to merge a branch and automatically delete it with a single command? The delete step should only be executed if merging was successful.
BendEg
  • 20,098
  • 17
  • 57
  • 131
67
votes
8 answers

Proper git workflow scheme with multiple developers working on same task

I'm a team leader in our web development company, and I'd like to implement Git workflow in our team. Reading documentation and articles I've found the following structure good for us: We have a repository in a Bitbucket. Master branch is considered…
Viktor Livakivskyi
  • 3,178
  • 1
  • 21
  • 33
66
votes
3 answers

Tortoisesvn Subversion 1.8 - merge - no more reintegrate a branch option

In tortoiseSvn 1.8 there is no "reintegrate" a branch option. What is the right way to reintegrate a branch in Tortoise Svn 1.8? In choose merge and then next option: Then I get next window: Or am I doing something else wrong?
Jernej Novak
  • 3,165
  • 1
  • 33
  • 43
59
votes
3 answers

Is it possible to get a list of merges into a branch from the Github website OR API?

In our workflow, no "direct" commits are made into the master branch. The master branch only receives merges from Pull Requests. We can think of each merge then as a new feature added to the master branch. So I'd like to get a list of merges into…
andy
  • 8,775
  • 13
  • 77
  • 122
58
votes
2 answers

Merge two remote branches in a Git repository

I have one remote repository with many branches. For example, my repository name is: http://navis.com/MyRepo.git Its branches are: development production (master) testing I would like to merge the development branch into the production (master)…
Sai Ye Yan Naing Aye
  • 6,622
  • 12
  • 47
  • 65
57
votes
4 answers

Creating a branch from issue in GitLab

I've just started using GitLab, and have created a set of issues, in order to keep an overview of what needs to be done for my application. I was wondering if it was possible to create a branch from these issues, such that the branch and issues are…
JonasN89
  • 1,386
  • 2
  • 11
  • 23
57
votes
7 answers

SVN branch compare

How do I compare one branch with another? I want to compare a branch with the latest revision in trunk.
tekumara
  • 8,357
  • 10
  • 57
  • 69
54
votes
3 answers

Move branch to another branch

I have started doing some work on a branch which I have in term realised was the wrong branch. Is there a way to move a branch to a different branch. For example: A -- B -- C -- D -- HEAD \-- E -- F -- G -- H -- I -- J \-- K -- L And I want…
user204088
  • 1,805
  • 3
  • 17
  • 21
54
votes
5 answers

Mercurial: Merging one file between branches in one repo

When I have two branches in Hg repo, how to merge only one file with another branch, without having all other files from changeset merged? Is it possible to merge only certain files, instead of whole changeset?
Jox
  • 7,132
  • 14
  • 49
  • 63
53
votes
6 answers

Automatically delete git branch after merge to master

We will be attempting a work flow in github where every ticket is a branch off of master. After the ticket is complete, the work is merged into staging where regression and integration tests are performed before it is merged into master. A team lead…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
50
votes
3 answers

Create a branch alias?

I am researching switching from starteam to Git. Currently, in starteam, we use "floating views" with special names. These floating views basically work like aliases. Therefore, we can specify a specific alias to checkout from and we'll get the…
user606723
  • 4,918
  • 2
  • 27
  • 34
49
votes
5 answers

git: merge branch and use meaningful merge commit message?

After I merge a feature branch back to main branch I usually need to do a merge commit by default. But I'd like to use the original commit messages from my feature branch in this commit instead of "merge branch XXX". How should I do that?
kakyo
  • 10,460
  • 14
  • 76
  • 140