kwan_ah
kwan_ah

Reputation: 1091

GIT - Having trouble with checkout to branch

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.

Upvotes: 0

Views: 69

Answers (2)

kwan_ah
kwan_ah

Reputation: 1091

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

Upvotes: 0

Paul Dixon
Paul Dixon

Reputation: 300815

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.

Upvotes: 2

Related Questions