git branches & merge

3 messages, 3 authors, 2016-10-13 · open the first message on its own page

git branches & merge

From: <hidden>
Date: 2016-10-12 14:08:24

Hi.
I have created a release_x branch to work on a new release. The branch is based
on master.
Later I needed to create a hotfix_x branch to work on a hotfix. This branch is
also based on master.

In the hotfix_x branch I needed to correct an IP address to communicate with.
After doing so, I merged the hotfix_x branch with master again and made my
deployment.

Now in the release_x branche the IP address is still the old one.
I am afraid of committing and merging my release_x branch since I think that my
newly defined IP address (now on master) will be overridden when merging.
Am I right? If yes, what is the best way to solve this?

Thanks
-fuz

Re: git branches & merge

From: Anatoly Borodin <hidden>
Date: 2016-10-12 14:43:54

Hi,


the IP will not be overwritten, you'll still have the new IP in
master. Nothing to worry about :)


-- 
Mit freundlichen Grüßen,
Anatoly Borodin

Re: git branches & merge

From: Kevin Daudt <hidden>
Date: 2016-10-13 15:57:50

On Wed, Oct 12, 2016 at 04:43:07PM +0200, Anatoly Borodin wrote:
Hi,


the IP will not be overwritten, you'll still have the new IP in
master. Nothing to worry about :)
To expand on that, git does a so called 3-way merge. This means git will
look for a common base commit, and compare changes from both sides to
see which side actually made a change.

In your case, the base and the release branch both should show the old
ip, and the master side would show the new IP. This tells git that
master has changed, and not the release branch, and takes the master
side of the change, resulting the new IP to show up.

Hope this helps, Kevin.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help