Committing one file vs several

In SourceTree when a try to select and commit a single file - I have to manually move the file to staging. When I have more than one file selected I can commit straight away. In the second case I assume the move to staging/index happens behind the scenes.

Is there method to this madness or is it just a bug?


Mark Levison

1 answer

1 accepted

1 vote
Answer accepted

The toolbar Commit button tries to be smart about what you intended - because browsing the diffs is done with a single-file selection (also the default), it can't really assume that you meant to jump directly to committing that one file. Since multi-selection is a much more explicit action, it assumes you did in fact mean just the current selection.

If you want SourceTree to always jump directly to committing even single-file selections, use the Commit Selected option instead. This is on the menu, and you can also customise the toolbar to use the alternative Commit Selected button too instead of the assumption-making Commit button. Also, right-clicking the file and selecting Commit always works in the context of that one file.

Lastly, if you don't like using staging, you can turn it off completely if you prefer. In Preferences > Git, uncheck the 'Use the staging area' checkbox, and all commits will be direct from your working copy in future.

Perfect. I appreciate the answer. I suspect I'm not the only one confused by this little detail. However I've always found GIT a bit confusing. In this case I just decided for my needs that staging is overkill - a few people running a small business, we almost always have access to our server. From this point of view staging is just a complication.


Mark Levison

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

283 views 0 12
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