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?

Cheers

Mark Levison

1 answer

1 accepted

1 vote
Accepted answer

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.

Cheers

Mark Levison

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

451 views 6 9
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