All about "checkout" ?

I use SourceTree with Btibucket hosting a git repo.

What does the tool bar Checkout button checkout?

When I clone, is something automatically checkedout?

After making some changes to my working copy that I don't want to keep, should I just do another checkout to get the working copy back to the state before the changes?

When should I use the Clean checkbox in the lower left corner of Checkout tab? It says (discard all changes), but isn't that what checkout does, overwrites current working copy and therfore dicarding all changes?

1 answer

When cloning the default branch is checked out automatically which is usually master.

The main purpose of checkout is to switch a working copy between branches, if you want to remove modifications but not switch branches you might as well just use the reset button, both ways work really but pls note either way you will still have untracked files sitting around.

The "clean" checkbox makes it easier to change branches by removing all modifications first (because it actually runs a git reset --hard and then the checkout). I find it misleading because there's a git command called clean that does something different to what the "clean" checkbox does.

I would totally accept your answer, if I could find the grey question mark so I could click it. Is there another way to accept it?

[edit] Image uploading seems to be broken. Look for a checkmark button under the voting buttons.

No checkmark button under the my voting buttons. I'm using Chrome Version 32.0.1700.72 m.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

799 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