All about "checkout" ?

Steve Kissh December 17, 2013

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

1 vote
Sumali January 9, 2014

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.

Steve Kissh January 15, 2014

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?

Aseem Parikh
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.
January 15, 2014

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

Steve Kissh January 15, 2014

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
TAGS
AUG Leaders

Atlassian Community Events