It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sourcetree and Visual Studio 2015

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?

1 answer

1 vote
Ana Retamal Atlassian Team Nov 29, 2017

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!

Ana

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.

Ana Retamal Atlassian Team Nov 30, 2017

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 :)

Cheers,

Ana

Like Ray Johnson likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,895 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you