This question is similar to this , but more specific.
I have a project with two branches ( staging and beta ).
I develop on staging and use the master branch to fix errors. Therefore, if I work on creation and see an error, I proceed to the master branch:
git checkout master
and do the following:
git add fileToAdd git commit -m "bug fixed"
and then I merge with two branches:
git checkout staging git merge master git checkout beta git merge beta
And it does not matter if there are other files on the working tree.
But now, when I try to switch to the master branch, I get an error message :
error: Your local changes to the following files would be overwritten by checkout: src/Pro/ConvocationBundle/Controller/DefaultController.php Please, commit your changes or stash them before you can switch branches. Aborting
I thought I should delete the file from the staging area:
git reset HEAD src/Pro/ConvocationBundle/Controller/DefaultController.php
but I get the same error. If I do git status , I get No changes to commit
git git-checkout
Manolo Mar 15 '14 at 13:01 2014-03-15 13:01
source share