Push new project to Github
Introduction
This is a quick explanation of how to get a project you're working on locally, onto a remote hosted Github repository that doesn't exist yet.
This is a simple task, yet I never do it enough to remember exactly the right steps to take. So here's a quick overview.
Steps
- Create a new project locally, for example a Sinatra app.
-
git init
in order to initialize your directory -
touch README.md
so that Github can display some text, make it useful. -
git add
all the files you want to include git commit -m "your commit message"
- Create a repository in your Github account on https://github.com
-
git remote add origin git@github.com:username/repo-name.git
This will set your remote repository for you. Use your github username and the repo-name is what you created on the web. -
git push -u origin master
will then get your repository finally pushed to the remote (set as origin). The -u is for credentials into your github repository.
Written by Arthur Chang
Related protips
2 Responses

First thing anyone going to work with Git should know. Useful tip!
over 1 year ago
·

Thanks for the tip, not to mention you should probably add a .gitignore file and ignore critical files.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Github
Authors

projectcleverweb
289.2K

jjperezaguinaga
90.23K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#