在切换到工作区并在Xcode中添加CocoaPods后提交git? [英] Commit to git after switching to workspace and adding CocoaPods in Xcode?

查看:164
本文介绍了在切换到工作区并在Xcode中添加CocoaPods后提交git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将CocoaPods添加到Xcode 5中的当前项目中。当然,CocoaPods创建了一个工作区,并且我已经在Xcode中启动了该工作区。我在工作区中看到了我的项目和Pods项目。



自第一天起,我的项目一直处于源代码管理(本地git +远程Bitbucket存储库)之下。现在我想提交并添加Pod的东西,但我认为我的回购在工作空间中太深 - 当我尝试提交时(并且我尝试了各种提交来获取Pod内容),它总是出错。

如何将我的Pod加入我的回购?我是否必须删除旧的回购库并在工作区级创建一个新的库(git init)? (我当然希望不是因为我不擅长使用git,而且我的回购库中有很多历史提交。)

git add。



从包含Xcode项目的目录中,执行 git add。。文档



很可能,您的 git 设置开始在 .xcodeproj



pod install ,层次没有改变。你只是有更多的文件在同一级别:





.xcworkspace 位于 .xcodeproj 的旁边,不在上面。您可以自由执行

  git add。 

...后面是

  git commit -mmessage

...假设 .gitignore 设置正确,无论您是否愿意提交 Pods 目录。


I've just added CocoaPods to my current project in Xcode 5. Of course, CocoaPods created a workspace and I've launched the workspace in Xcode. I see both my project and the Pods project in the workspace.

My project has been under source control (local git + remote Bitbucket repository) since day one. Now I want to commit and add the Pod stuff but I think that my repo is too deep in the workspace--when I try to commit (and I've tried various commits to get the Pod stuff to take) it always errors out.

How can I add my Pods to my repo? Do I have to delete the old repo and create a new one (git init) at the Workspace level? (I sure hope not because I'm not that great with git and I have a lot of historical commits in my repo already.)

解决方案

git add .

From the directory enclosing your Xcode project, simply execute a git add .. Documentation here.

Explanation

You likely had the following hierarchy prior pod init:

In all likelihood, your git setup starts at the directory enclosing .xcodeproj.

After pod install, the hierarchy did not change. You merely have more files at the same level:

The .xcworkspace is next to .xcodeproj, not above. You are free to execute

git add .

...followed by

git commit -m "message"

...assuming that .gitignore is set up properly, and wether or not you prefer to commit the Pods directory.

这篇关于在切换到工作区并在Xcode中添加CocoaPods后提交git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆