git将本地项目初始化提交到远程仓库

2022-03-25  本文已影响0人  zhujunhua

...create a new repository on the command line

echo "# t1" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:zhujunhua2012/t1.git
git push -u origin main

...or push an existing repository from the command line

git remote add origin git@github.com:zhujunhua2012/t1.git
git branch -M main
git push -u origin main

PS:
github中新建一个repository,就会跳出如上的提示步骤。

上一篇下一篇

猜你喜欢

热点阅读