If you want to add local code to a new remote git repository without 'cloning' the old remote, do the following
Create the remote repository and get its url like:
[email protected]:/youruser/somename.git or https://github.com/youruser/somename.git
Locally, at the root directory of your source,
git init
(If you initialize the repo with a .gitignore and a README.md you should do a git pull {url} to ensure you don't commit files to source that you want to ignore).
Add and commit what you want in your initial repo.
To attach your remote repo with the name 'origin'
git remote add origin [URL ]
Execute git pull origin master to pull the remote branch so that they are in sync.
To push up your master branch:
git push origin master
Thus, you can import existing code to github.