xcode 如何在源代码控制下获取 Images.xcassets?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20567075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:25:35  来源:igfitidea点击:

How do I get Images.xcassets under source control?

iosxcodegitxcode5

提问by S'pht'Kr

So I migrated my AppIcons and LaunchImages to Images.xcassets, which is working fine it seems. But I made some modifications to the launch images, and now I went to commit the changes (I'm using a local-only git repo), and it seems Images.xcassets is not allowed to be committed to source control? Right-clicking on it, all the source control options are greyed out. And it doesn't show up in Xcode 5's new "global" commit dialog.

所以我将我的 AppIcons 和 LaunchImages 迁移到 Images.xcassets,这看起来运行良好。但是我对启动图像做了一些修改,现在我去提交更改(我使用的是仅限本地的git repo),似乎不允许将Images.xcassets提交给源代码管理?右键单击它,所有源代码控制选项都变灰了。它不会出现在 Xcode 5 的新“全局”提交对话框中。

Seems ridiculous not to allow the assets file to be committed, am I missing something?

不允许提交资产文件似乎很荒谬,我错过了什么吗?

回答by Matthias Bauch

This is most likely a bug in Xcode. Please file a bug report with Apple: http://bugreport.apple.com

这很可能是 Xcode 中的一个错误。请向 Apple 提交错误报告:http: //bugreport.apple.com

As a workaround use the "global" commit dialog and select "File View" in the top of the side bar. The relevant files should then show up.

解决方法是使用“全局”提交对话框并选择侧栏顶部的“文件视图”。然后应显示相关文件。

enter image description here

在此处输入图片说明

回答by AFK

Almost 2 years later, the same functionality exists for Xcode 7.1. The workaround that Matthias offers still allows you to upload assets.xcassets.

差不多 2 年后,Xcode 7.1 也有了同样的功能。Matthias 提供的解决方法仍然允许您上传 assets.xcassets。

回答by zevij

An alternative could be to try something along the lines of:

另一种方法是尝试以下方法:

cd /to/the/folder/

git ls-files --others --exclude-standard | grep .imageset | xargs git add

git commit...

回答by thatzprem

Quitting the Xcode & reopening the project again worked!

退出 Xcode 并重新打开项目再次奏效!