如何使用 Xcode 添加 README.md 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13021599/
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
How can I add a README.md file with Xcode?
提问by flip79
I'm trying to add a README.md file in my Xcode Project, and push it to GitHub. How can I do it? Creating a file inside the root of the project doesn't work because - I think - Xcode doesn't see it.
我正在尝试在我的 Xcode 项目中添加一个 README.md 文件,并将其推送到 GitHub。我该怎么做?在项目的根目录中创建文件不起作用,因为 - 我认为 - Xcode 看不到它。
采纳答案by JBT
I just solved the same problem, so allow me to share my finding.
我刚刚解决了同样的问题,所以请允许我分享我的发现。
- From Xcode, select the project root in the Project Navigator.
- Right click, and select
Add Files to <Your Project>...
- Choose README.md; make sure to uncheck the copy-file option and any group, like this:
- Click Add.
- Done.
- 在 Xcode 中,在 Project Navigator 中选择项目根目录。
- 右键单击,然后选择
Add Files to <Your Project>...
- 选择 README.md;确保取消选中复制文件选项和任何组,如下所示:
- 单击添加。
- 完毕。
回答by AppsWise
This is how I did it -
我就是这样做的-
1 - Create a new file by ctrl+click in root folder of the project within xCode.
1 - 通过 ctrl+click 在 xCode 中项目的根文件夹中创建一个新文件。
2 - Once done choose file type other from left pan and then pick empty file. Rename it to Readme.md
while saving the file.
2 - 完成后,从左盘中选择其他文件类型,然后选择空文件。Readme.md
保存文件时将其重命名为。
3 - The Readme.md
file should be created in the root folder as displayed in above screen-shot.
3 - 该Readme.md
文件应在根文件夹中创建,如上面的屏幕截图所示。
That is it that should do. When you push the code to the repository your Readme.md
file should be displayed properly.
这才是应该做的。当您将代码推送到存储库时,您的Readme.md
文件应该会正确显示。
B.R
BR
回答by kayaker243
There are basically two questions here. The first is how to add a README.md file and push it to GitHub. touch README.md; git add README.md; git commit -m "added README.md"; git push origin
这里基本上有两个问题。首先是如何添加一个 README.md 文件并将其推送到 GitHub。touch README.md; git add README.md; git commit -m "added README.md"; git push origin
The second is one of file visibility. I think what you're running into here is that Xcode keeps a file manifest record of sorts for its projects. Try reading through this question: Xcode does not pick up new class files in SVN
第二个是文件可见性之一。我认为您在这里遇到的是 Xcode 为其项目保留各种文件清单记录。尝试通读这个问题:Xcode does not pick up new class files in SVN
Are you adding the file within Xcode or the terminal/finder?
您是在 Xcode 还是终端/查找器中添加文件?
回答by stilldodge
You should be able to just add to project File->New->File->Other->Empty
您应该能够添加到项目 File->New->File->Other->Empty
When added you will need to select and do File->Source Control->Add File->Source Control->Commit
添加后,您需要选择并执行 File->Source Control->Add File->Source Control->Commit