Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

dylan-nicholson June 8, 2017

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 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2017

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.

dylan-nicholson June 12, 2017

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
TAGS
AUG Leaders

Atlassian Community Events