0

I have a problem when I try to checkout to a branch. Im getting the error:

Please, commit your changes or stash them before you can switch branches. error: The following untracked working tree files would be overwritten by checkout: build/classes/bp/conf/db/user.sql build/classes/bp/conf/db/user_group.sql build/classes/bp/conf/db/user_info.sql build/classes/views.properties 

I cannot stash or commit them because those files are included in the .gitignore.

Please help.

2
  • sounds like they are in your gitignore, but actually in the branch you are switching to. Commented Jun 11, 2013 at 7:47
  • git stash -u for untracked files? Apparently you're going from a place where they are not ignored to where they are checked in, so checking them out would overwrite those in your work directory, even though they are now ignored. Commented Jun 11, 2013 at 7:55

2 Answers 2

2

The branch you are switching to has these ignored files checked in, so you need to do something with them.

Either delete them, move them out of the way, git stash them, or commit them.

If you want to commit them, use git add -f to force them to be added.

Sign up to request clarification or add additional context in comments.

Comments

0

I just solved it with rm -r build/ to remove untracked files and continue checkout to a branch. :)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.