1.先用vs打开本地项目;
2.在vs上创建Git库:

注意
此时的远程库一定是新建的,不能有提交记录,比如下面的仓库,虽然没有项目文件,但是有提交记录:

这个时候在vs里面推送会报错:
Updates were rejected because the tip of your current branch is behind
(更新被拒绝,因为当前分支的落后与远程分支)
解决办法在这里:git push报错:Updates were rejected because the tip of your current branch is behind-CSDN博客
新的远程仓库长这样子:

这个时候直接推送http地址就直接推到远程的Master分支了。
题外话:在本地Copy项目时会直接把本地仓库和远程仓库的设置Copy出来,要是想本地项目重新提交到另一个远程仓库的话,要Copy本地项目的第二层文件夹(一般有.sln文件存在的那一层):
看不懂什么意思不要紧,说明你不需要。
