3
我在分支feature/branch1
,git status
列出我在.gitignore
文件上的兩個文件。當我嘗試籤至develop
分支機構,Git會阻止我這個消息:Git問我提交忽略文件
error: Your local changes to the following files would be overwritten by checkout:
XXXXXXX.xcworkspace/xcuserdata/XXXX.xcuserdatad/UserInterfaceState.xcuserstate
Please, commit your changes or stash them before you can switch branches.
Aborting
然後我嘗試雖然它們在.gitignore
文件中列出添加這些文件,所以我得到這個消息:
The following paths are ignored by one of your .gitignore files:
XXXXXXX.xcworkspace
Use -f if you really want to add them.
fatal: no files added
爲什麼git要求我添加這些文件?是因爲它們在develop
分支中不被忽略。處理這種情況的最佳選擇是什麼?提前Thanx。