最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]Xcode中git更新[email protected]时又出错了:The working copy “iOS-Client” failed to commit files.error: pathspec Assets.xcassets/Image.imageset/版本更新@3x.png did not match any file(s) known to git.

Git crifan 3156浏览 0评论

The working copy “iOS-Client” failed to commit files.
error: pathspec ‘JianDao/JianDao/Assets.xcassets/Image.imageset/版本更新@3x.png’ did not match any file(s) known to git.
error: pathspec ‘JianDao/JianDao/Assets.xcassets/Image.imageset/版本更新.png’ did not match any file(s) known to git.
error: pathspec ‘JianDao/JianDao/Assets.xcassets/Image.imageset/Contents.json’ did not match any file(s) known to git.
error: pathspec ‘JianDao/JianDao/Assets.xcassets/Image.imageset/版本更新@2x.png’ did not match any file(s) known to git.

感觉是:

自己拖动的图片到Assets.xcassets中的

改为:

导入图片,或许就可以了??

去看了,对应的是有本地的文件的:

不是file 的reference

搜:

xcode error: path spec  Assets.xcassets Image.imageset @3x.png  did not match any file(s) known to git

xcode error pathspec assets.xcassets image.imageset did not match any file(s) known to git

Git: cannot checkout branch – error: pathspec ‘…’ did not match any file(s) known to git – Stack Overflow

xcode – Git pathspec error: Iconr did not mach any files – Stack Overflow

xcode error pathspec assets.xcassets image.imageset

xcode error  path spec  did not match any file(s) known to git

Xcode – error: pathspec ‘…’ did not match any file(s) known to git – Stack Overflow

才注意到:

此处上述文件路径:

‘JianDao/JianDao/Assets.xcassets/Image.imageset/版本更新.png’

的确不存在,只存在:

my_version_update.imageset

-》

/Users/crifan/dev/dev_root/daryun/JianDao/iOS-Client/JianDao/JianDao/Assets.xcassets/My/my_version_update.imageset/版本更新.png

 

感觉是:

好像是:

最开始,直接拖动文件到Asset中

-》导致了Xcode中只记录到

Image.imageset/版本更新.png

-》而后续,新建了个文件夹My,然后把这些图片都移动到My文件夹了

-》估计Xcode中的git没有更新

-》导致找不到路径,而报错

-》删除这些图片和文件夹

-》先建立文件夹,再去拖动文件进入

看看是否可行。

然后看看commit是否ok:

果然就可以了。。。

再去把余下的image asset补全:

图片也都可以正常工作和显示了:

再去commit:

然后就的确可以正常commit提交了。

[总结]

此处Xcode中git commit出错:

error: pathspec ‘JianDao/JianDao/Assets.xcassets/Image.imageset/版本更新@3x.png’ did not match any file(s) known to git.
error: pathspec ‘JianDao/JianDao/Assets.xcassets/Image.imageset/版本更新.png’ did not match any file(s) known to git.

的原因是:

原先以为是:版本更新@3x.png

又出现git不支持[email protected]的事情呢

-》后来想起来,其他已经有类似的文件名的图片正常的commit了

-》并且此处版本更新.png也不能commit

所以不是此问题

-》然后后来猜测的是对的:

由于先拖动x1,x2,x3的各个图片到assets中的

-》所以Xcode(的git)就只记录了对应的路径是:

Assets.xcassets/Image.imageset/版本更新@3x.png

-》而对于后续新建文件夹My并移动版本更新@3x.png到对应My中,

Xcode(的git)就没有及时记住,没有更新文件路径

-》导致了,实际上此处已经是:

Assets.xcassets/Image.imageset/My/my_version_update.imageset/版本更新@3x.png

但是实际上Xcode还以为是(最开始的)

Assets.xcassets/Image.imageset/版本更新@3x.png

从而找不到文件,报错了

-》可见Xcode(中的git)还是足够弱智,bug足够多啊。。

转载请注明:在路上 » [已解决]Xcode中git更新[email protected]时又出错了:The working copy “iOS-Client” failed to commit files.error: pathspec Assets.xcassets/Image.imageset/版本更新@3x.png did not match any file(s) known to git.

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.217 seconds, using 22.11MB memory