If you haven't already created the project in Github, do so on that site. If memory serves, they display a page that tells you exactly how to get your existing code into your new repository. At the risk of oversimplification, though, you'd follow Veeti's instructions, then:
git remote add [name to use for remote] [private URI] # associate your local repository to the remote
git push [name of remote] master # push your repository to the remote
It seems like Github has changed their layout since you posted this question. I just created a repository and it used to give you instructions on screen. It appears they have changed that approach.
Here is the information they used to give on repo creation:
Just to add on to the other answers, before i knew my way around git, i was looking for some way to upload existing code to a new github (or other git) repo. Here's the brief that would save time for newbs:-
Assuming you have your NEW empty github or other git repo ready:-
Alternatively if you have an existing local git repo
cd "/your/repo/dir/repoName"
#add your remote github or other git repo
git remote set-url origin https://github.com/user_AKA_you/your_repoName
git commit -m "new origin commit"
git push origin master
The easiest way to get your project into GitHub Desktop is to drag the
folder which contains your project files onto the main application
screen.
If you are dragging in an existing Git repository, you can skip ahead
and push your code to GitHub.com.
If the folder isn’t a Git repository yet, GitHub Desktop will prompt
you to turn it into a repository. Turning your project into a Git
repository won’t delete or ruin the files in your folder—it will
simply create some hidden files that allow Git to do its magic.
In Windows it looks like this:(GitHub desktop 3.0.5.2)
In Linux use below command to upload code in git
1 ) git clone repository
ask for user name and password.
2) got to respositiory directory.
3) git add project name.
4) git commit -m ' messgage '.
5) git push origin master.
- user name ,password
Update new Change code into Github
->Goto Directory That your github up code
->git commit ProjectName -m 'Message'
->git push origin master.