smeeb smeeb - 2 months ago 14
Git Question

Merging multiple master branches into each other on git/GitHub

I have a GitHub repo that started its life out with only a

master
branch, and I pushed a bunch of code to it. Then I created a
development
branch (via
git checkout -b development
) locally on my machine and pushed it (via
git push origin development
), but no changes were made to it, other than just creating it (meaning
master
and
development
were now identical).

Another developer was supposed to create a
fizzbuzz
feature branch off of the
development
branch, but instead created it off of
master
(which was up to date). She now has pushed her
fizzbuzz
branch to GitHub.

Ultimately I want
fizzbuzz
merged into
development
, which would then kick off a CI build and DEV deployment. Then, at a later time, I will merge
development
into
master
.

But I don't think this is possible to do because she created
fizzbuzz
off of
master
instead of
development
. Is it? And if not, what's the solution? Is there a way for her to "rebase"
fizzbuzz
to be a branch of
development
(if so what are the commands?), or some other alternative approach?

kfb kfb
Answer

You very nearly answered your own question! git rebase development fizzbuzz will rebase fizzbuzz onto development. If you then git push origin fizzbuzz --force, GitHub will update the base branch.

Comments