See the answer I linked to above if you already have a project without a Git repository.
After making a change in your project, select Commit... from the Source Control menu. You will add a short commit message.
On the GitHub website make a new repository. Call it whatever you want, but don't add a README or .gitignore or license yet. After creating the new repository copy the link to it.
in Xcode go to Source Control > your branch name > Configure. Then click the Remote tab > "+" button > Add remote. Fill in your repository name and address.
Go to Source Control > Push. You will have to enter your GitHub user name and password the first time.
That's it. Now any time you make changes in Xcode, all you have to do is Commit and Push.
If you didn't follow this explanation, please read this and this for more detail.
This is an excellent video that I recently watched that helped me understand Git and its integration with GitHub much better.
An easier way to do it in Xcode. You can even push only one current branch to GitHub or the whole project.
(for Xcode 11)
Just select a needed branch/(or top folder) in "Source control navigator" and right-click on it. Then select "Create remote". Or "Editor -> Create remote".
Then use your account at GitHub to create the repository. If using your GitHub account is not proposed maybe you still not add your GitHub account in Xcode -> Preferences -> Accounts
After that check Github. All should be there.
Get the Github Mac Application, you don't really need a terminal unless you want to do more fancy advanced stuff ;-)
Simply go to your project page on GitHub, then click on "Clone in Mac", this should automatically download and install it for you. You have to do this at least once to install the app and setup some required permissions.
After that, you'll see the GitHub Application in your Dock, simply open it, then click on that small "+" sign at the bottom, there you'll see "Create New Repository" and "Add New Local Repository".
You can either add the repository that XCode already created for you or download one from GitHub, then open it in XCode.
if you already have a git repo on your Mac and using Xcode 9,
for xcode 9, just go to the source control tab in the navigation inspector in Xcode. right click on the master git and select create "Your project name" remote on GitHub.
give your GitHub credentials and give a name to git repo and Xcode will create and push your code for you.
a non terminal solution is to install SourceTree. Its a GUI thats super easy to use compared to the terminal. But its highly recommended to learn git commands properly.
Recent (2023) answer (I'm on Xcode 14, but suspect this has been available for a while): Assuming you enabled source control when you created your Xcode project (enabled by default),
Go to your source control navigator, select "Repositories", right/secondary click on "Remotes" under your project name, and add a new remote.
Xcode will walk you through logging into GitHub (or other remote git repositories), including name selection. No need for any extra software, and no need to create a repo on remote side first.
Xcode screenshot