Git aborting a checkout

3

I'm trying to jump from branch but git is aborting the operation.

I'm in the dev branch trying to go to the master branch:

$ git checkout master

Error:

error: Your local changes to the following files would be overwritten by checkout:
.env
Please, commit your changes or stash them before you can switch branches.
Aborting

But when checking my desktop I can not find anything $ git status :

No ramo dev
Your branch is up-to-date with 'dev/master'.

nada a submeter, diretório de trabalho vazio

As I also try to make a $ git stash :

 No local changes to save

I tried to use git checkout -f master but it did not work:

 error: Entry '.env' not uptodate. Cannot merge.

Note: .env was originally in .gitignore , but in order to be able to send to a remote repository I had to remove it . Then I made the git push I needed, I went into .gitignore again I added it and made a git update-index --assume-unchanged .env to remove it from the versioning.

    
asked by anonymous 19.06.2014 / 17:08

1 answer

3

With great help from @ rafaels88, we were able to solve:

  • First I made a git checkout .env
  • After% w / w%
  • Finally git rm .env
  • 19.06.2014 / 23:24