Merge 2 Git branches?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
Hi all!

This:

1. The Git Repository.

2. A project which has 2 branches:
v2 — it has produced and tachometry changes in 3 files. Suppose that it is in the first row 10, second 5, third 6.

master — the changes in those 3 files in the same rows, but they also needed.
3. The conflict in the merge between master and v2.
Task:

1. How to resolve the conflict?

2. Is there a way to take changes from v2 only interested in rows and files and apply them to the master
by | 12 views

3 Answers

0 like 0 dislike
Right in your case will be
\r
1) git rebase master
\r
of the auxiliary branch. Probably involves the resolution of possible conflicts.
\r
2) git rebase -i HEAD^^^
\r
of the auxiliary branch. We collect a few auxiliary branch commits into one (optionally, but often, for accurate design of commits required)
\r
3) git merge secondary-branch --ff-only
\r
from the main branch. Mergim with fast-forward (i.e. without solving the conflicts) the new commits from the auxiliary branch
\r
That is, you begin by making changes from the main to the auxiliary branch, and then turn on the new commits from auxiliary to main.
\r
Sometimes it makes sense to do git rebase -i auxiliary branch to itself to combine several commits into one.
\r
If it is short. A good practice is the lack of the merge commits in the main branch.
by
0 like 0 dislike
Alas, if git itself could not resolve the conflict, then definitely make it automatically impossible.
\r
To take only the required changes, you can, if you simply copy a tree v2 on top of the wood master, and then record only the changes with git add --interactive. Still unnecessary then removed via git checkout ., which will reset the working directory to the index (all that was added using git add, left).
by
0 like 0 dislike
everything can be done using diff
start, compare, choose what to take and where.
even has a GUI included in TourtoisGIT
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
27,835 users