
Create a new repository on Github

Add .gitignore file
As you can see there is an option: Add .gitignore

It is for the local file in your computer which you don’t want git to track them. And then you can put it in the .gitignore and then it will not track it and push it into the repository.
Create a new project on Xcode
Randomly edit it, here I add a new line in the code. Then type $ git status in the terminal to track it. And then I add it and commit it.1

Until now, our local repository is not talking to our remote one, and remote one is also not talking to our local one.
$ git remote -v
//It will show all the remote repository I have. But right now we have none.So now we are going to add one by this:
$ git remote add origin [SSH link]//origin is the name of the remote

$ git remote -v//Now you can see the remote repository which you just add, and now you can fetch and push up to that repository.$ git add -A$ git commit -m "Hello World"//push the change to the remote repository
Pull from the remote repository
$ git pull origin master //fetch files from remote
$ git push origin master //send file to remoteNow it merged, the local and remote repository, as you can see the README.md file is also show on the local. And the local Xcode project also can be found in your Github.

In short, how we do this:
You have remote repository on Github. And now you’re going to make some changes.
$ git add
$ git commit
$ git pull origin master //Before you push, pull all the things from remote to merge it.
$ git push origin master //And push all these changes on remote.
Notes of learning with Mark Price.
