# git branches & merge

3 messages from 2016-10-12 to 2016-10-13. Participants: webmaster@peter-speer.de, Anatoly Borodin, Kevin Daudt.
Thread: https://gitlist.dev/t/44289

## webmaster@peter-speer.de, 2016-10-12 13:50

Subject: git branches & merge
Message-ID: <1240187899.41938.1476280216470.JavaMail.open-xchange@app08.ox.hosteurope.de>
URL: https://gitlist.dev/e/1240187899.41938.1476280216470.JavaMail.open-xchange%40app08.ox.hosteurope.de

```
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

```

## Anatoly Borodin, 2016-10-12 14:43

Subject: Re: git branches & merge
Message-ID: <CACNzp2nG1KfFuiSH1UUGVSz1T39PjzfDgCp6vqOVe7-Lph2yNw@mail.gmail.com>
URL: https://gitlist.dev/e/CACNzp2nG1KfFuiSH1UUGVSz1T39PjzfDgCp6vqOVe7-Lph2yNw%40mail.gmail.com
In-Reply-To: <1240187899.41938.1476280216470.JavaMail.open-xchange@app08.ox.hosteurope.de>

```
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

```

## Kevin Daudt, 2016-10-13 15:49

Subject: Re: git branches & merge
Message-ID: <20161013154959.GB1698@ikke.info>
URL: https://gitlist.dev/e/20161013154959.GB1698%40ikke.info
In-Reply-To: <CACNzp2nG1KfFuiSH1UUGVSz1T39PjzfDgCp6vqOVe7-Lph2yNw@mail.gmail.com>

```
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.

```
