first of all imagine that you have installed git on your computer, assuming that you see the root of your project from the terminal.
first of all Create a new repository on GitHub (if you already have it okay). To avoid errors, do not initialize the new repository with the README, license or gitignore files. You can add these files after your project has been sent to GitHub.
Initialize the local directory as a Git repository.
git init
Add the files in your new local repository. This prepares them for the first commitment.
git add .
Add the files in the local repository and the stages for confirmation. To stop recording a file, use 'git reset HEAD YOUR-FILE'.
Confirm the files that you have organized in your local repository (your project)
git commit -m "Primer commit"
Confirm the tracked changes and prepare them for submission to a remote repository. To eliminate this commitment and modify the file, use 'git reset --soft HEAD ~ 1' and confirm and add the file again.
At the top of the Quick Settings page of the GitHub repository, click to copy the URL of the remote repository.
git remote add origin remote repository URL
# Establece el nuevo control remoto
git remote -v
# Verifica la nueva URL remota
then you push the changes in your local repository to GitHub.
git push origin master
with the push the changes are modified in your local repository to the remote repository that you specified as the source
more info
A common problem that happens is that you have not added the git user for that just look at this simple tutorial:
users - github