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

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: http://git-scm.com/book/en/v2/Git-Branching-Rebasing

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

425 views 0 1
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