My team has a repository of many C#/.NET projects coded in Visual Studio 2015 and we are trying to migrate our codebase from SVN to Git hosted on Bitbucket. One thing I'm struggling with after the migration is how to cleanly switch between tags using Sourcetree. The problem is that when I compile and run my application from master, many DLLs and other binaries are generated in my project folder. If I then checkout a new tag on Sourcetree (with "Clean (discard all changes)" selected), I can see all of my DLLs are still there and rebuilding and running the application can result in some weird behaviour that can only be explained by having the old DLLs in there.
Basically, my question is: is there a way to checkout a tag in Sourcetree truly cleanly so that the state of the repository is just as if I freshly checked out the repo from remote and then immediately switched to a new tag?
Hi Ian, afaik that's what should be happening. You might want to have a look at git clean, although this is a command that needs to be run in the command line, as it's not implemented in Sourcetree. You can read more about it at git-clean.
Hope that helps!
Thanks Ana. I think the problem is that it is not git clean-ing my ignored files. Is there a way to force a clean of everything including ignored files? I think TortoiseGit handles this by passing -fx to the clean command. Not sure how this is done in Sourcetree.
Hmmm, so you mean that you have ignored files that are still appearing? Keep in mind that if the files have already been tracked, .gitignore will not prevent them from being added. This means, if the files were tracked before, they will continue to be tracked, to stop tracking a file you need to remove it from the index, you can achieve this with the command:
git rm --cached <file>
The removal of the file from the head revision will happen on the next commit.
Let us know if that's what you meant :)
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot