添加pod文件并推送。如何撤消?如何在Xcode中使用gitignore& GitHub的? [英] Added pod files and pushed. How to undo? how to use gitignore in Xcode & github?

查看:154
本文介绍了添加pod文件并推送。如何撤消?如何在Xcode中使用gitignore& GitHub的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个两部分问题:
1)我添加了提交并将所有pod文件推送到github。有没有办法我可以删除它们,而不是再次将它们推到github上?



2)我知道giti​​gnore可以提供帮助,但我不知道如何使用它。任何人都可以请我走过使用gitignore的过程?



所以我认为我可以做的是,从github获得项目,添加gitignore,然后再次推送。那是对的吗?



请帮忙,github& Xcode中。

解决方案

没错,您需要将Pods目录添加到 .gitignore



1)从您的github存储库中删除您的文件:

git rm -r Pods /



不要忘记提交和推送

2)创建一个gitignore文件:


  1. 打开终端并浏览您的项目文件夹< .git文件夹所在的位置

  2. 输入 touch .gitignore

  3. 输入 echoPods /> .gitignore

更多信息:这里


This is a two part question: 1) I have added committed and pushed all pod files to github. Is there a way I can remove them and not push them again to github?

2) I know gitignore can help, but I don't know how to use it. Can anyone please walk me through the process of using gitignore?

so I think what I can do is, get the project from github, add gitignore, and then push again. is that correct?

Please help, new to github & Xcode.

解决方案

That's correct, you need to add the Pods directory to your .gitignore

1) Remove your files from your github repository:

git rm -r Pods/

and don't forget to commit and push

2) Create a gitignore file:

  1. Open terminal and go through your project folder where the .git folder is located
  2. Type touch .gitignore
  3. Type echo "Pods/" > .gitignore

More informations : here

这篇关于添加pod文件并推送。如何撤消?如何在Xcode中使用gitignore&amp; GitHub的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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