Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Branching Issue, code not switching

Robert Benedetto April 24, 2015

Hi, I have just started SourceTree with BitBucket and I love the product, except for the following issue: I can't seem to be able to switch between branches? I mean, the actual switch is there, I see the highlighting of the different branches, but the code always remains the same?

If I am on my Branch A and switch back to my MASTER branch, I still see all the changes I made in Branch A when I open the project?

This is driving me nuts. Can anyone help out? Oh, I'm developing in C# using Visual Studio if that has something to do with it.

Regards, Bob

3 answers

1 accepted

0 votes
Answer accepted
Michael Hawkins April 24, 2015

I don't know how familiar you are with git (I'm assuming you're using git) but if you have uncommitted changes in your current branch you will either need to commit them or stash them (set them aside without adding them to your git db) before switching to a different branch.

 

0 votes
Robert Benedetto April 26, 2015

Thanks to both of you for your answers. I am pretty new to GIT indeed. Turns out I had switched branches before committing. Once I had done that, switching between branches worked fine. Thanks a lot!

0 votes
Tim Crall
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.
April 24, 2015

You should be able to switch branches by double-clicking the branch you want in the sidebar.  The current branch should turn bold - the highlighting alone does not indicate that you've actualy changed branches.

 

Double clicking on a commit that is the top of a branch (or using the Checkout button to checkout a commit that is the tip of a branch) should also put you on that branch (but this could be ambiguous if more than one branch pointer points to the commit)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events