Git 本地仓库与远程仓库链接

1.在远程仓库新建一个空项目

2.在本地新建好项目后使用命令 

【1. 告诉git你是谁

git config --global user.name "你的名字或昵称"

git config --global user.email "你的邮箱"

【2. 设置远程仓库的链接

git remote add origin https://gitee.com/***/项目名.git

3.使用 git push origin master  -f  把本地仓库同步到远程仓库的master分支上

4. 修改提交地址 git remote set-url origin https://gitee.com/***/项目名.git

5. 远程仓库地址先删后加 

git remote rm origin
git remote add origin [url]

原文地址:https://www.cnblogs.com/chefweb/p/8360552.html