Working in a branch, trying to switch to the main trunk, I get the error message:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree checkout master
error: The following untracked working tree files would be overwritten by checkout:
LogLevels.cpp
Please move or remove them before you can switch branches.
Aborting
Completed with errors, see above
I created the file LogLevels.cpp, I renamed it as logLevels.cpp (lowercase initial), without letting git know. Now I commited all the changes in the branch, everything seems to be fine, but I cannot go back to the main trunk.
How can I fix this problem? I tried deleting the file from both the directory and from git, and copying it from backup, with no results.
I'm not sure what you want to do with LogLevels.cpp but I'll assume you want to keep it around in the stash. In Sourcetree, click the terminal button:
Then type
git stash -u
This should put the file on the stash and remove it from the workspace. Then go ahead and switch branches with
git checkout master
Or you can just exit out the terminal and double click the branch you want to switch to on Sourcetree.
If you want to bring back the file to your workspace after you have switched branches, you can go back into the terminal and type
git stash apply