建立本地仓库与远程仓库的联系(git)
本文最后更新于:2022年10月12日 上午
建立本地仓库与远程仓库的联系
1.建立本地仓库
git init
2.添加所有文件到暂存区
git add .
3.提交所有文件
git commit -m "注释" -a
4.新建远程仓库
新建一个仓库,复制其链接
5.连接远程仓库
git remote add origin https://gitee.com/Elcfin/try.git
(链接)
6.推送到远程仓库
git push -u origin master
如果远程仓库非空,如建立时选择README.md初始化,则发生冲突
此时可输入
git push -u origin master -f
强制覆盖远程仓库
建立本地仓库与远程仓库的联系(git)
https://elcfin.github.io/2021/11/09/建立本地仓库与远程仓库的联系/