GIT-无法签出到分支机构
我在尝试结帐到分行时遇到问题。我得到了一个错误:GIT-无法签出到分支机构,git,git-checkout,Git,Git Checkout,我在尝试结帐到分行时遇到问题。我得到了一个错误: 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/
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
我无法隐藏或提交它们,因为这些文件包含在.gitignore
中
请提供帮助。您切换到的分支已签入这些被忽略的文件,因此您需要对它们进行处理 要么删除它们,要么移开它们,要么提交它们
如果要提交它们,请使用强制添加它们。我刚刚用
rm-r build/
解决了这个问题,以删除未跟踪的文件并继续签出到分支。:) 听起来它们好像在gitignore中,但实际上在您切换到的分支中。git stash-u
用于未跟踪的文件?很明显,您要从一个不忽略它们的地方转到它们被签入的地方,所以签出它们将覆盖工作目录中的那些,即使它们现在被忽略。