I was just about to leave a comment above, but I will also add a generic answer. My complete answer is here .
This is not via the terminal as requests, but you can consider this an alternative method. It integrates well with Xcode now, but not complicated.
Create a Git repository when creating a new project

See the answer related to above if you already have a project without a Git repository.
Make commit

After making changes to the project, select Commit ... from the Source Control menu. You will add a short commit message.
Create a New GitHub Repository

On GitHub, create a new repository. Name everything you want, but don't add a README or .gitignore or license. After creating a new repository, copy the link to it.
Add Remote Access to Xcode
in Xcode, go to Source Control > your branch name> Customize . Then click the Remote tab> + "> Add remote . Fill in the name and address of your repository.

Submit your project to GitHub
Go to Source Control > Press . The first time you will need to enter your GitHub username and password.
What is it. Now that you are making changes to Xcode, all you have to do is Commit and Push .
If you have not followed this explanation, read this and this for more details.
Further research
This is a great video that I recently watched that helped me better understand Git and its integration with GitHub.
Suragch Sep 10 '15 at 10:00 2015-09-10 10:00
source share