0

I'm just starting to use GIT, and i'm trying to understand if i'm correct. Let's say we have branch Master, branches Bug1, Bug2 If i want to merge branch Bug1 into Bug2, i would do something like:

git checkout bug2
git merge bug 1
git commit -m "Merged Branch bug1 into branch bug2"
git push

So, does it correct way to merge branch Bug1 into branch Bug2?

1

1 Answer 1

0

Use patch mode to avoid conflicts. For example:

git pull origin master #pull from master

git checkout -p origin/bug1  #patch bug1 branch

git checkout -p origin/bug2  #patch bug2 branch

git checkout -b myMerge #rename branch

git commit -m "Patched diffs from branches bug1 and bug2"

git push

References

2
  • Is this equivalent to merging as OP did, then squashing the commits? How is that avoiding merge conflicts?
    – kutschkem
    Commented Nov 13, 2018 at 14:27
  • @kutschkem This avoids merge conflicts by avoiding merge itself. It is based on the linux diff and patch commands. Commented Nov 14, 2018 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .