After you have created your application, place your code in a git repository. You have options on where to host your code, but the simplest is hosting it on GitHub. This page describes how to host your code on GitHub.
After logging in, create a new repository. (Click New repository.)
Give your project a name and description and click Create Repository.
Follow the GitHub instructions to connect your local git repository with your GitHub repository. Note: If your code is in a Subversion (SVN) repository, see GitHub:Help Import from Subversion.
After you have completed the GitHub, your application code is stored remotely on GitHub. Whenever you make any local changes in your git repository and want to have it pushed to your remote GitHub repository, type git push while inside of your local repository; git will push your newly committed code to GitHub.
Important! Make sure to put your application root directory at the root level of your git repository. Don’t put it in a subdirectory. (The application root directory is the one that contains the app, config, and public directories.)