github 将本地代码和远程库关联方法
…or create a new repository on the command line
echo “# utils” >> README.md
git init
git add README.md
git commit -m “first commit”
git branch -M main
git remote add origin git@github.com:YOUR.git
git push -u origin main
…or push an existing repository from the command line
git remote add origin git@github.com:YOUR.git
git branch -M main
git push -u origin main
这篇博客详细介绍了如何将本地的代码仓库与GitHub远程仓库进行关联并推送代码。首先创建一个新的仓库,然后初始化本地Git,添加README文件,进行第一次提交,并设置主分支。接着添加远程仓库地址,最后推送主分支到远程仓库。这个过程适用于已有代码仓库或者新创建仓库的情况。
1466

被折叠的 条评论
为什么被折叠?



