How to switch to other branch in Source Tree to commit the code?

Atlassian Sourcetree

Atlassian Sourcetree Problem Overview


Recently I have installed Source Tree in my windows machine. How can I use the source tree for commit, merge of code to central repository?? And also how can I switch the branches ?? Can any one kindly provide me the links on how to overcome this??

Atlassian Sourcetree Solutions


Solution 1 - Atlassian Sourcetree

Hi I'm also relatively new but I can give you basic help.

  1. To switch to another branch use "Checkout". Just click on your branch and then on the button "checkout" at the top.

UPDATE 12.01.2016:

The bold line is the current branch.

You can also just double click a branch to use checkout.


  1. Your first answer I think depends on the repository you use (like github or bitbucket). Maybe the "Show hosted repository"-Button can help you (Left panel, bottom, right button = database with cog)

And here some helpful links:

Easy Git Guide

Git-flow - Git branching model

Tips on branching with sourcetree

Solution 2 - Atlassian Sourcetree

  1. Go to the log view (to be able to go here go to View -> log view).
  2. Double click on the line with the branch label stating that branch. Automatically, it will switch branch. (A prompt will dropdown and say switching branch.)
  3. If you have two or more branches on the same line, it will ask you via prompt which branch you want to switch. Choose the specific branch from the dropdown and click ok.

To determine which branch you are now on, look at the side bar, under BRANCHES, you are in the branch that is in BOLD LETTERS.

Solution 3 - Atlassian Sourcetree

Sometimes it is impossible to click on correct branch in history view. Find branch you want in left panel, under remote and double click it.

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpraneethView Question on Stackoverflow
Solution 1 - Atlassian SourcetreemfgmichaView Answer on Stackoverflow
Solution 2 - Atlassian SourcetreenycdanieView Answer on Stackoverflow
Solution 3 - Atlassian SourcetreeKajboView Answer on Stackoverflow