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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.