git init .
git remote add origin <http/someURL>
git pull origin master
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
git remote add origin <link>
# To add origin
$ git remote add origin <github repo link>
git remote add origin https://github.com/example/Git-CheatSheet.git
git remote add new-origin git@github.com:manakor/manascope.git
--::-- Using SSH --::--
#### Create SSH key ####
$ ssh-keygen -t ed25519 -C "<YourEmail>@<Domain>.com"
#### Copy the SSH key ####
$ cat /path/to/private_key_file.pub
#### Add the SSH key to your GitHub account ####
$ echo "# myPracticeRepo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git config core.sshCommand 'ssh -i /path/to/private_key_file'
$ git remote add origin git@github.com:<UserName>/<RepoName>.git
$ git push -u origin main
--::-- Using HTML --::--
$ echo "# myPracticeRepo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin https://github.com/<UserName>/<RepoName>.git
$ git push -u origin main
$ git init --bare ~/repos/myproject.git
$ cd /path/to/existing/repo
$ git remote add origin ~/repos/myproject.git
$ git push origin master
git remote rename new-origin origin
git push --all new-origin
git push --tags new-origin