I'm looking to have the repository track files that are not in the same folder or subfolder as the `.git` folder by making the Main Working Tree a different folder. This is completely allowed in git and required for a use case of mine (the folder to be tracked is occasionally deleted and regenerated entirely by the IDE, which would delete the `.git` folder as well).
This is a loaded question; I'm miffed about a 3 year old Sourcetree for Windows bug (duplicate) that deletes files instead of staging them and it was just suggested to me it is not a bug, I'm just not doing it right. So what is the SourceTree approved way to change the location of the main working tree?
The way I have been doing it is to edit the repository config files to add:
`worktree = C:\\Some\\Path` and git starts tracking that folder instead of the one containing the `.git` folder. This works fine when only using git via the terminal or alternate GUIs, but attempting to stage a file in SourceTree will delete it instead. Yes, staging a file you just worked on will delete it. Not just fail to stage it, it is gone. It isn't in the recycle bin, SourceTree deleted it just when you were hoping to save your changes to git.
So, if editing the repo config file isn't how you change the main working tree location in SourceTree, then how do you do it?
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
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