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.
5 Answers
This is how I did it -
1 - Create a new file by ctrl+click in root folder of the project within 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.
3 - The Readme.md
file should be created in the root folder as displayed in above screen-shot.
That is it that should do. When you push the code to the repository your Readme.md
file should be displayed properly.
B.R
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.

- 8,498
- 18
- 65
- 104
-
3If the `readme.md` is located outside the directory structure that becomes part of the git repo, you *do* want to check the "Copy items.." checkbox. Otherwise, you are just storing a symlink to something outside the folder. – wcochran Jan 28 '15 at 17:41
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
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
Are you adding the file within Xcode or the terminal/finder?

- 1
- 1

- 2,580
- 3
- 22
- 30
-
Thank you. I managed to add README manually within the terminal, following the sequence of command you suggested. It works, but Xcode still ignores the existence of the file in the root of the project. I tried to take a look to the .xcodeproj file but it's not too clear, maybe it's better to leave it untouched :) It seems that Xcode doesn't consider files that are in the root folder, together with the .xcodeproj file! – flip79 Oct 23 '12 at 06:52
You should be able to just add to project File->New->File->Other->Empty
When added you will need to select and do File->Source Control->Add File->Source Control->Commit

- 204
- 1
- 2
-
Thank you, I already tried this, but Xcode adds the readme into the root/nameofmyproject folder, and not directly into the root, so it is invisible for github. – flip79 Oct 23 '12 at 06:53
You can also do it this way:
File->New->File->Other->Markdown File
Then click on next and by default the name of the file will be README.md

- 142
- 2
- 9