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

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
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
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...

2,002 views 1 5
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