Branching Issue, code not switching

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

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.

 

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)

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!

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

706 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot