xcode 我可以向我的 .gitignore 添加什么,以便我可以防止签入我的 github 存储库上的 Pod?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20105475/
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:19:24  来源:igfitidea点击:

What can I add to my .gitignore so that I can prevent checking in pods on my github repo?

iosxcodegithubgitignorecocoapods

提问by 3254523

I am looking to transition to checking in only the podfile in my Github repo instead of constantly checking in every single pod whenever I run a pod install. . right now my gitignore code CocoaPods looks like this looks like this

我希望过渡到仅检入 Github 存储库中的 podfile,而不是在运行 pod install 时不断检入每个 pod。. 现在我的 gitignore 代码 CocoaPods 看起来像这样

    Pods/Pods-Acknowledgements.markdown
    Pods/Pods-Acknowledgements.plist
    Pods/resources-to-copy.txt
    Pods/resources-to-copy-*.txt

I am still getting a ton of xcconfig files from Cocoapods that are being checked in. help please?

我仍然从正在签入的 Cocoapods 获取大量 xcconfig 文件。请帮忙?

回答by nomann

To ignore just the sub folders of Pods proj file:

仅忽略 Pods proj 文件的子文件夹:

Pods/*.xcodeproj/xcuserdata/
Pods/*.xcodeproj/project.xcworkspace/xcuserdata/

To ignore everything inside Pods folder

忽略 Pods 文件夹中的所有内容

Pods/

回答by James McDonnell

I'm not sure how your files are structured. But you should just be able to add Pods/* to your .gitignore and then when you want to add a specific file to git use:

我不确定您的文件的结构如何。但是您应该能够将 Pods/* 添加到您的 .gitignore 中,然后当您想将特定文件添加到 git 时使用:

git add Pods/IWANTTHISFILE --force

That should do the trick.

这应该够了吧。

回答by Lehlohonolo_Isaac

Just add the following and your problem is solved:

只需添加以下内容即可解决您的问题:

    Pods/