In repo dir, create a blank repo git init Stage existing files git add . git commit -m "<some message>." Create remote repo in GitHub using REST API with MFA curl -u "<github username>" -H "X-GitHub-OTP:<token>" https://api.github.com/user/repos -d '{"name":"<repo name>"}' Set Git user details in repo git config user.name "<github username>" git config user.email "<github email>" First ensure valid entries in ~/.ssh/config and valid ssh key in GitHub git remote add origin git@github.com:<github username>/<repo name>.git git remote set-url origin git@<ssh config host entry label>:<github username>/<repo name>.git git push --set-upstream origin master Test creds ssh -T git@github.com