远程仓库
推送本地仓库到空的远程仓库
create a new repository on the command line
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/yanxin152133/test.git ## https://github.com/yanxin152133/test.git 远程仓库地址
git push -u origin main
push an existing repository from the command line
git remote add origin https://github.com/yanxin152133/test.git ## https://github.com/yanxin152133/test.git 远程仓库地址
git branch -M main
git push -u origin main
拉取远程仓库
git clone https://github.com/yanxin152133/test.git ## https://github.com/yanxin152133/test.git 远程仓库地址
从远程获取代码库
$ git fetch origin
20 August 2026