Q:

git connect to remote repository

$ git remote add origin https://github.com/user/repo.git
# Set a new remote

$ git remote -v
# Verify new remote
> origin  https://github.com/user/repo.git (fetch)
> origin  https://github.com/user/repo.git (push)
0
# when you are not connected to the network, you can use this
git config --get remote.origin.url
5
git remote add heroku https://git.heroku.com/arrecs.git
git remote -v
-> heroku	https://git.heroku.com/arrecs.git (fetch)
-> heroku	https://git.heroku.com/arrecs.git (push)

git remote remove heroku
git remote -v
10
echo "# HarryFoods" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin < repo url >
git push -u origin main
1
git init
git commit -m "[message]"
git remote add origin "github repository link"
git push -u origin master
0
git remote add origin <remote repository URL>
# Sets the new remote
git remote -v
# Verifies the new remote URL
git push origin master
0

New to Communities?

Join the community