当尝试切换Xcode 7 beta 3或6.4中的分支时,我得到“工作副本有未提交的更改”。如果提交或放弃所有更改,然后再试一次,则得到相同的结果。
更新:
所以现在我不能再查另一家分行了,不管我怎么做:
MacBook-Air:Åka Strax andreas$ git reset --hard
HEAD is now at 9190d8c omstrukturerat typerMacBook-Air:Åka Strax andreas$ git status
HEAD detached at 9190d8c
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: "A\314\212ka Strax.xcodeproj/project.pbxproj"
Untracked files:
(use "git add <file>..." to include in what will be committed)
"N\303\244rliggandeH\303\245llplatser.swift"
no changes added to commit (use "git add" and/or "git commit -a")MacBook-Air:Åka Strax andreas$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
Åka Strax.xcodeproj/project.pbxproj
Please, commit your changes or stash them before you can switch branches.
AbortingMacBook-Air:Åka Strax andreas$ git rm --cached "Åka Strax.xcodeproj/project.pbxproj"
rm 'Åka Strax.xcodeproj/project.pbxproj'MacBook-Air:Åka Strax andreas$ git status
HEAD detached at 9190d8c
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: "\303\205ka Strax.xcodeproj/project.pbxproj"
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: "A\314\212ka Strax.xcodeproj/project.pbxproj"
Untracked files:
(use "git add <file>..." to include in what will be committed)
"N\303\244rliggandeH\303\245llplatser.swift"
"\303\205ka Strax.xcodeproj/project.pbxproj"最初的“解决”并发症:
下面是git status和一些命令(按顺序排列),它们回答了类似的问题:
MacBook-Air:Åka Strax andreas$ git status
On branch swift_2.0-tester
Your branch is ahead of 'origin/swift_2.0-tester' by 1 commit.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
"N\303\244rliggandeH\303\245llplatser.swift"
"\303\205ka Strax.xcodeproj/project.xcworkspace/xcshareddata/"
"\303\205ka Strax.xcodeproj/xcuserdata/"
nothing added to commit but untracked files present (use "git add" to track)MacBook-Air:Åka Strax andreas$ git reset --hard HEAD
HEAD is now at a69fdbeMacBook-Air:Åka Strax andreas$ git status
On branch swift_2.0-tester
Your branch is ahead of 'origin/swift_2.0-tester' by 1 commit.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
"N\303\244rliggandeH\303\245llplatser.swift"
"\303\205ka Strax.xcodeproj/project.xcworkspace/xcshareddata/"
"\303\205ka Strax.xcodeproj/xcuserdata/"
nothing added to commit but untracked files present (use "git add" to track)MacBook-Air:Åka Strax andreas$ git add "N\303\244rliggandeH\303\245llplatser.swift"
fatal: pathspec 'N\303\244rliggandeH\303\245llplatser.swift' did not match any filesMacBook-Air:Åka Strax andreas$ git rm --cached "N\303\244rliggandeH\303\245llplatser.swift"
fatal: pathspec 'N\303\244rliggandeH\303\245llplatser.swift' did not match any files我真的不明白git在告诉我什么。
发布于 2015-08-02 18:43:26
从某些文件系统(如HFS+)上的文件名来看,Git似乎从根本上被打破了。Git似乎天真地期望所有文件系统对文件标识符/文件名都有相同的要求。在创建文件时,OSX可能不会将Git的实际文件名交给Git,尽管这听起来有些牵强。
我只在OS上使用这个回购,但我似乎仍然会遇到文件名编码问题。
为了解决这个问题,我被迫只在我的文件名中使用ASCII。感觉就像回到过去。
发布于 2015-08-01 19:00:11
默认情况下,git status的路径输出是转义的,使用操作系统提供的文件名(linux上的ls .),在这种情况下,您可以尝试使用git add NärliggandeHållplatser.swift。
有关更多信息,请参见core.quotePath at https://www.kernel.org/pub/software/scm/git/docs/git-config.html
https://stackoverflow.com/questions/31762768
复制相似问题