The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sourcetree (for Mac) is committing unstaged files

Brady
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 5, 2019

Not sure if I am missing a setting or if this is a legitimate bug.  Whenever I commit, it also commits my unstaged files/hunks.  This is obviously very frustrating and has caused some code to be committed that I was not ready to commit or ever intended to be committed.  I have included some screenshots to illustrate a simple scenario.  Below I only intend to commit the changes for the one file 'environment.dev.ts'.  As you can see I left the 2 other files unstaged as I do not intend to commit those changes quite yet.  However, after committing the changes I pulled up the commit which shows that all 3 files were committed up anyways.

 

Before Commit (Staging):

Staging_PreCommit.png

After Commit: 

Post_Commit.png

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
David Webster
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2026

This happened to me and I found that it was caused by a local hook. The hook had code that was staging files immediately before the commit.

I realize this is a very old thread, but perhaps my answer will still help someone.

 

0 votes
James Ballard
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 25, 2021

TL;DR - reclone your repo from scratch.

Ok I have an actual answer for this one. It was an unknown repo issue for me. Here's what I did to determine that:

1. Wiped all Sourcetree settings, and tried the same thing again - same problem happened.

2. Restored all Sourcetree settings: tried the same thing with a new test repo - could not reproduce the problem.

3. Blew away and recloned my local repo - problem went away.

 

I hope this helps someone out there. @Chris Burkhardt @Brady maybe this will help.

0 votes
James Ballard
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 24, 2021

I am also having this issue on Mac, still with version 4.1.0 (237). This is maddening since it is making me look foolish to my colleagues since my commits are containing work-in-progress pieces that I never staged.

 

I have to ditch Sourcetree until this is fixed.

0 votes
Chris Burkhardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2020

The same thing is happening to me. I am not sure how to solve it so I went back to command line and stopped using SourceTree for now.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events