Creating git repository for you existing xcode project can be done as follow:
- Use the
cd
command to switch to your project directory, making it the current working directory. - Enter
git init
to create an empty repository. - Enter
git add .
to copy your project files into the repository. - Enter
git commit -m "Initial commit"
to commit all the files.
For more details take a look at Setting Up a Subversion Repository.