xxxxxxxxxx
# To add origin
$ git remote add origin <github repo link>
xxxxxxxxxx
below is used to a add a new remote:
git remote add origin git@github.com:User/UserRepo.git
below is used to change the url of an existing remote repository:
git remote set-url origin git@github.com:User/UserRepo.git
below will push your code to the master branch of the remote repository defined with origin and -u let you point your current local branch to the remote master branch:
git push -u origin master
xxxxxxxxxx
git remote add origin https://github.com/example/Git-CheatSheet.git
xxxxxxxxxx
$ git init --bare ~/repos/myproject.git
$ cd /path/to/existing/repo
$ git remote add origin ~/repos/myproject.git
$ git push origin master