Git Merge Question

Hi, See questions in Bold.

From my master branch I "git checkout -b ABC"

do my changes, then add and commit the changes "git commit -am 'Made a fix'"

checkout my stage which is an active on Github "git checkout stage"

then merge with ABC "git merge ABC" I am also prompted to list a commit message here, is there a way to make it carry over from ABC?

then push "git push origin stage"

Also, is there a simpler process to achieve all of this, or is this about it?
LVL 3
Computer GuyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gurpsbassiCommented:
try rebasing onto the stage branch
Kyle HamiltonData ScientistCommented:
I don't think there is a way to carry over the message. However, you are performing a new action, so the new message might be more along the lines of "merging with ABC". You will still see the commit message in your history.

Rebasing is really bad practice unless everyone on your team knows what they are doing really well. Lots of debate over this online, so go ahead and google it.

I don't think there is any shortcut to do what you are doing.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kyle HamiltonData ScientistCommented:
you could always add some aliases to your .bash_aliases file, for example:

alias gca='git commit -am'

then in your shell all you have to do is:

gca "my commit message"
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

gurpsbassiCommented:
Rebasing is really bad practice unless everyone on your team knows what they are doing really well

Would be interested to know what problems it has presented you. I've been using rebase for many years without issue.
Kyle HamiltonData ScientistCommented:
When you rebase you rewrite history. This can cause pain if you're trying to go back and find something you committed before history was rewritten. I personally prefer to see all the ugly history and have the ability to go back and cherrypick very specific commits if I need to - it happens. Some people prefer a clean looking repo.

I am not really arguing for one or the other. I am merely warning that when you rebase strange things can seem to happen, and unless you're really up to speed with how it all works, it can be a real PIA to figure out wtf happened.
gheistCommented:
Where is the problem in writing one-line commit mesage "I am trying to merge ABC" ?
Kyle HamiltonData ScientistCommented:
@gheist, I don't think anyone claimed this to a problem. In fact, that is what I'm suggesting. cheers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Git

From novice to tech pro — start learning today.