添加pod文件并推送。如何撤消?如何在Xcode中使用gitignore& GitHub的? [英] Added pod files and pushed. How to undo? how to use gitignore in Xcode & github?
问题描述
这是一个两部分问题:
1)我添加了提交并将所有pod文件推送到github。有没有办法我可以删除它们,而不是再次将它们推到github上?
2)我知道gitignore可以提供帮助,但我不知道如何使用它。任何人都可以请我走过使用gitignore的过程?
所以我认为我可以做的是,从github获得项目,添加gitignore,然后再次推送。那是对的吗?
请帮忙,github& Xcode中。
没错,您需要将Pods目录添加到 .gitignore
1)从您的github存储库中删除您的文件:
git rm -r Pods /
不要忘记提交和推送
2)创建一个gitignore文件:
- 打开终端并浏览您的项目文件夹< .git文件夹所在的位置
- 输入
touch .gitignore
- 输入
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:
- Open terminal and go through your project folder where the .git folder is located
- Type
touch .gitignore
- Type
echo "Pods/" > .gitignore
More informations : here
这篇关于添加pod文件并推送。如何撤消?如何在Xcode中使用gitignore& GitHub的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!