【Git】Git 仓库初始化


命令行新建本地仓库并远程关联

git init
git add .
git commit -m "first commit"
git branch -M master
git remote add origin <repository-url>
git push -u origin master

命令行远程关联本地已有仓库

git remote add origin <repository-url>
git branch -M master
git push -u origin master

老是忘记这几个命令,记录一下。