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

一. 与本地仓库进行关联

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

git remote add origin git@github.com/helloworld/hello.git
Git与远程仓库关联以及关联错误解决方法

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

git remote add origin https://github.com/helloworld/hello.git
Git与远程仓库关联以及关联错误解决方法

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

2.1输出 .git

rm -rf .git
Git与远程仓库关联以及关联错误解决方法

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

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

2.3 再次添加并提交

git add 文件
git commit -m " "
Git与远程仓库关联以及关联错误解决方法

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

 

相关文章:

  • 2022-02-12
  • 2021-12-23
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
猜你喜欢
  • 2022-01-11
  • 2021-08-20
  • 2022-12-23
  • 2021-08-16
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案