I have a remote Git server, here is the scenario which I want to perform:
For each bug/feature I create a different Git branch
I keep on committing my code in that Git branch with un-official Git messages
In top repository we have to do one commit for one bug with official Git message
So how can I merge my branch to remote branch so that they get just one commit for all my check-ins (I even want to provide commit message for this)?
git rebase -i
and the (accepted) answer of abyx? – Teddmangit merge --squash
does it all on the command line in one shot and you just hope it works.git rebase -i
brings up an editor and lets you fine-tune the rebase. It's slower, but you can see what you're doing. Also, there are difference between rebase and merge which are a little too involved to address in a comment. – Girliemerge --squash
from the old to the new one, and then merge the new branch to master. The old branch becomes obsolete. – Georama