git push existing code to new repository

Shell
git add .
git commit -m "message for the commit"
git remote add origin https://url-of-github-repo
git push origin mastergit remote add origin <remote repository URL>
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
$ git init
Source

Also in Shell: