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

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
Accepted answer

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.)

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?

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:

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
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,126 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you