码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-11-25 16:07:27      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:用户名   git   方法   set   widget   image   kaa   代码   .com   

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

一. 与本地仓库进行关联

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

git remote add origin git@github.com/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 " "
技术分享图片

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

 

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

标签:用户名   git   方法   set   widget   image   kaa   代码   .com   

原文地址:https://www.cnblogs.com/youpeng/p/10015435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!