Git与远程仓库关联以及关联错误解决方法

假设你github的用户名是  helloworld  ,你在上面创建了一个 名为 hello 的 repository.

一. 与本地仓库进行关联

1.1用原生ssh进行关联,速度快:

git remote add origin [email protected]/helloworld/hello.git

1.2用https进行关联,速度相对ssh慢点:

git remote add origin https://github.com/helloworld/hello.git

二.如果不小心关联错了,则需要删除这份关联,再去关联新的

2.1输出 .git

rm -rf .git

2.2 再次建立git仓库,并初始化

git init

2.3 再次添加并提交

git add 文件
git commit -m " "

然后再进行关联就可以了。

猜你喜欢

转载自www.cnblogs.com/youpeng/p/10015435.html