最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

[已解决]xcode的git提交出错:error pathspec Assets.xcassets imageset @3x.png did not match any file(s) known to git

Git crifan 884浏览 0评论

Xcode的git去提交代码时出错

The working copy “SalesAppiOS” failed to commit files.

error: pathspec ‘SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/not_keep_record_selected@3x.png’ did not match any file(s) known to git.

error: pathspec ‘SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/not_keep_record_selected.png’ did not match any file(s) known to git.

error: pathspec ‘SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/not_keep_record_unselected@3x.png’ did not match any file(s) known to git.

error: pathspec ‘SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/not_keep_record_selected@2x.png’ did not match any file(s) known to git.

error: pathspec ‘SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/not_keep_record_unselected@2x.png’ did not match any file(s) known to git.

error: pathspec ‘SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/not_keep_record_unselected.png’ did not match any file(s) known to git.

如图:

其实自己此时就知道了:

之前通过:

手动的修改对应Assets中的图片的:

名字

对应内部的:

x1,x2,x3的文件名

以及对应的Contents.json

是不行的。

估计是:

需要:在Xcode中操作这个事情

删除旧的图片assets

新建新的,重新加入图片

-》让xcode自己知道对应的事情

-》然后xcode才能生成对应的git内部的动作

-》最后此处去提交时,才有对应的图片文件

此处先去看看git状态:

licrifandeMacBook-Pro:SalesAppiOS crifan$ git status

On branch master

Your branch is up-to-date with ‘origin/master’.

Changes to be committed:

  (use "git reset HEAD <file>…" to unstage)

modified:   SalesApp.xcodeproj/project.pbxproj

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/Contents.json -> SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/Contents.json

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/Contents.json -> SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/Contents.json

deleted:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/not_keep_record_selected.png

deleted:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/not_keep_record_selected@2x.png

deleted:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/not_keep_record_selected@3x.png

deleted:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/not_keep_record_unselected.png

deleted:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/not_keep_record_unselected@2x.png

deleted:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/not_keep_record_unselected@3x.png

modified:   SalesApp/CustomerDetailNameTableViewCell.swift

new file:   SalesApp/CustomerDetailTestDriveTableViewCell.swift

modified:   SalesApp/CustomerDetailViewController.swift

modified:   SalesApp/GlobalConstants.swift

new file:   SalesApp/ImageLabelBadgeButton.swift

new file:   SalesApp/LeftImageRightLabelButton.swift

Untracked files:

  (use "git add <file>…" to include in what will be committed)

SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/checkbox_selected.png

SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/checkbox_selected@2x.png

SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/checkbox_selected@3x.png

SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/checkbox_unselected.png

SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/checkbox_unselected@2x.png

SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/checkbox_unselected@3x.png

licrifandeMacBook-Pro:SalesAppiOS crifan$

不用去删除图片,再新建图片了。

-》去git中添加对应的图片,应该就可以了。

licrifandeMacBook-Pro:SalesAppiOS crifan$ git add SalesApp/Assets.xcassets/Customer/checkbox_*

licrifandeMacBook-Pro:SalesAppiOS crifan$ git status

On branch master

Your branch is up-to-date with ‘origin/master’.

Changes to be committed:

  (use "git reset HEAD <file>…" to unstage)

modified:   SalesApp.xcodeproj/project.pbxproj

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/Contents.json -> SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/Contents.json

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/not_keep_record_selected.png -> SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/checkbox_selected.png

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/not_keep_record_selected@2x.png -> SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/checkbox_selected@2x.png

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_selected.imageset/not_keep_record_selected@3x.png -> SalesApp/Assets.xcassets/Customer/checkbox_selected.imageset/checkbox_selected@3x.png

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/Contents.json -> SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/Contents.json

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/not_keep_record_unselected.png -> SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/checkbox_unselected.png

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/not_keep_record_unselected@2x.png -> SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/checkbox_unselected@2x.png

renamed:    SalesApp/Assets.xcassets/Customer/not_keep_record_unselected.imageset/not_keep_record_unselected@3x.png -> SalesApp/Assets.xcassets/Customer/checkbox_unselected.imageset/checkbox_unselected@3x.png

modified:   SalesApp/CustomerDetailNameTableViewCell.swift

new file:   SalesApp/CustomerDetailTestDriveTableViewCell.swift

modified:   SalesApp/CustomerDetailViewController.swift

modified:   SalesApp/GlobalConstants.swift

new file:   SalesApp/ImageLabelBadgeButton.swift

new file:   SalesApp/LeftImageRightLabelButton.swift

licrifandeMacBook-Pro:SalesAppiOS crifan$

再去Xcode中提交,就可以了:

去:

git pull

licrifandeMacBook-Pro:SalesAppiOS crifan$ git pull

remote: Counting objects: 8, done.

remote: Compressing objects: 100% (8/8), done.

remote: Total 8 (delta 5), reused 0 (delta 0)

Unpacking objects: 100% (8/8), done.

From http://git.oschina.net/QorosSalesApp/SalesAppiOS

   57cbf44..780c39e  master     -> origin/master

Merge made by the ‘recursive’ strategy.

SalesApp/AddTaskViewController.swift        | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++——————–

SalesApp/DatePickerViewController.swift     |   9 ++++—-

SalesApp/ServerApi.swift                    |   4 ++++

SalesApp/TaskTypeSelectViewController.swift |   8 ++++—

SalesApp/TaskViewController.swift           |   2 +-

5 files changed, 95 insertions(+), 32 deletions(-)

licrifandeMacBook-Pro:SalesAppiOS crifan$ git status

On branch master

Your branch is ahead of ‘origin/master’ by 2 commits.

  (use "git push" to publish your local commits)

nothing to commit, working directory clean

licrifandeMacBook-Pro:SalesAppiOS crifan$ git push

Counting objects: 20, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (20/20), done.

Writing objects: 100% (20/20), 4.38 KiB | 0 bytes/s, done.

Total 20 (delta 12), reused 0 (delta 0)

To http://git.oschina.net/QorosSalesApp/SalesAppiOS

   780c39e..f5d0fd8  master -> master

licrifandeMacBook-Pro:SalesAppiOS crifan$

即可。

转载请注明:在路上 » [已解决]xcode的git提交出错:error pathspec Assets.xcassets imageset @3x.png did not match any file(s) known to git

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
62 queries in 0.122 seconds, using 18.82MB memory