New Git users here. We have been going about things incorrectly and I am trying to clean things up. We have a temp branch and a master branch. Changes have been made and pushed on both branches. Ultimately I would like to get everything from the temp branch over onto the master branch and then I remove the temp branch so I can implement GitFlow. In source tree what branch should be checked out when I click merge and how can I ensure that I am merging the temp branch to master and not vice versa?

1 answer

1 accepted

This widget could not be displayed.

In source tree what branch should be checked out when I click merge and how can I ensure that I am merging the temp branch to master and not vice versa?

You always need to be on the branch where you want to merge your changes into - in your case: "merging the temp branch to master" means; checkout master and merge the changes from branch temp. That's not a question of the git-client (i.e SourceTree) but a general question on git.


Ultimately I would like to get everything from the temp branch over onto the master branch and then I remove the temp branch so I can implement GitFlow

Change the current branch to master in git on Stackoverflow seems to give the answer here.

You always need to be on the branch where you want to merge your changes into

Consider yourself being the branch to be merged into: do you want to fetch the changes on your own - or do you want to be forced by another branch to involve it's changes? I think you prefer deciding on your own, which changes should be incorporated rather than being forced to involve the changes...

Therefore: While merging, you have to be on the branch where you want to merge the changes from another branch into.

Suggest an answer

Log in or Sign up to answer
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...

862 views 2 3
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