Reputation: 92
I am working on windows. Using Git I am trying to switch to another local branch but it won't let me due to this error:
Your local changes to the following files would be overwritten by
checkout:
codelibrary/inc/variables.php
But when I do git status on my current branch, I get:
nothing to commit, working tree clean
I've seen 2 questions that are the same as mine in these links:
But none of the answers seem to solve my problem.
I suspect I had the file ignored in my current branch but not in the branch I want to switch to.
I'm new to git so I would like to ask the git pros to please help me with this.
Upvotes: 1
Views: 911
Reputation: 4476
This happens when you have an untracked file in your path which is tracked in the branch you try to checkout. Git will not know what to do with this file (which one to use between the tracked and the untracked one, so it refuses to checkout the branch.
Upvotes: 4