After creating a repository on git, how to push code to it

If you don't have a repository locally:

echo “# toutiao” >> README.md
git init
git add README.md
git commit -m “first commit”
git branch -M main
git remote add origin [email protected]:imkf-zhang/toutiao.git
git push -u origin main

have a local warehouse

git remote add origin [email protected]:imkf-zhang/toutiao.git
git branch -M main
git push -u origin main

Guess you like

Origin blog.csdn.net/weixin_43131046/article/details/123167413