rgamber
rgamber

Reputation: 5849

Git merge in a pull request on Github

I have a branch called hotfix (branched from the master branch) for which I opened a pull request on Github. The request page said that the hotfix branch is not up to date and provided me an option to Update Branch. On clicking this option, it says Merging branch 'master' into hotfix.

So I just wanted to ask that the master branch will remain as is, right? The wording above is a little ambiguous to me. If not, what is the right way to do it on the Github UI?

Upvotes: 1

Views: 103

Answers (3)

Rohith
Rohith

Reputation: 33

Yes, the master branch will remain as is. It is just your branch "hotfix" which is again updated with the latest master branch code.

Upvotes: 1

Andrew Miner
Andrew Miner

Reputation: 6165

The language "merging X into Y" means that any new commits which are present on X, but aren't on Y will be added after all the commits currently on Y. Or, if you currently have:

master:    A - B - C - D - E
               \
hotfix:          X - Y - Z

After merging master into hotfix, you'll have:

master:    A - B - C - D - E
               \           \
hotfix:          X - Y - Z - C - D - E

Upvotes: 1

ifma
ifma

Reputation: 3818

Yes that is equivalent to the following set of commands, if you were trying to do this locally:

git checkout hotfix  // hotfix is behind master by some number of commits       
git merge master

Which just synchronizes your hotfix branch, but leaves the master branch intact. It will grab the changes from master, which aren't in your branch, into your branch:

https://help.github.com/articles/syncing-a-fork/

Upvotes: 1

Related Questions