Why can't sourcetree detect automatically that I need to add new files?

If I add, e.g., a new .cs file to a visual studio project (.csproj file), or similarly for other popular development environments, SourceTree should be able to detect automatically that this new .cs file must be added to source control when I stage/commit. Many times I've had builds fail on our ci system just because I've added a new reference to a file to a project file but forgotten to add the file itself. The visual studio git integration does handle this automatically but unfortunately doesn't work well for me for other reasons.

1 answer

0 vote

You are correct that SourceTree doesn't automatically add changed files to the git index.

I'll be honest I don't think Visual Studio does either.
By default. as far as I can see, Visual Stage does not stage anything, rather when you do a  commit it stages AND commits in 1 step.

If you select a changed file in Team Explorer in SourceTree and right click you can see an explicit stage command in the context menu.

I wasn't suggesting it should necessarily automatically stage them but at least highlight such files at the top of the pending list. Actually parsing the csproj file isnt even necessary, just the ability to specify a pattern for new files to look for would work well. As it is my pending files is often full of irrevelant files and unless I'm really on top of maintaining the ignore list it's very easy to miss new files that need adding.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

569 views 1 2
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