How to properly rebase or merge and keep the branch when using Gitflow

Deleted user January 11, 2015

Here's what my graph looks like:

Screen Shot 2015-01-11 at 11.03.48 PM.png

I want to keep the feature/deployScripts branch, but I want it to have all the latest code from develop. I assume I need to rebase, or do I right-click on develop and "Merge develop into feature/deployScripts"?

1 answer

1 accepted

0 votes
Answer accepted
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2015

You can do either of those. The difference between the two is how the history graph will look afterwards. (If you want to see, create a copy of your clone folder and do the rebase in one of the copies, the merge in the other.)

(On your screenshot, it seems that the feature/deployScripts branch is not checked out, first you need to check that branch out.)

Deleted user January 11, 2015

Can you explain more about the history. I went with merge and when I look at branch's history it's the same as the branch I merged from so it's clean but shows an accurate history. I should mentioned that I squashed my commits first. So all in all I'm happy with the result. Any downsides to doing it this way? If it rebased instead how would the history be different?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2015

First of all, since you only had one unique commit in your branch, the squash did not really do anything (it would combine your commits into one). The rebase/merge story is a rather long one. It is quite well explained here: http://git-scm.com/book/en/v2/Git-Branching-Rebasing

Deleted user January 11, 2015

I squashed before I sent the screenshot. :-) Thanks for the link. I'll check it out.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events