git remote add origin <http地址>

 

使用“git remote add origin”指令,可以轻松地将本地项目连接到远程Git仓库.

git remote add origin <远程Git仓库地址>


1. 更改默认的远程仓库

在项目中可能存在多个远程仓库,如果你想更改默认仓库,可以使用如下指令:

    git remote set-url origin <新的远程Git仓库地址>

2. 查看当前的远程仓库

如果你想查看当前项目的远程仓库,可以使用如下指令:

git remote -v

3. 删除远程仓库

如果你需要删除已经添加的远程仓库,可以使用如下指令:

    git remote rm origin

链接:https://blog.csdn.net/yuzheh521/article/details/132015573

==================================

https://www.runoob.com/git/git-remote.html

==================================

git remote -v 可以查看当前仓库中配置的远程仓库列表以及它们的 URL

origin 为远程地址的别名。

显示某个远程仓库的信息:

git remote show [remote]
git remote show https://github.com/tianqixin/runoob-git-test

添加远程版本库:

git remote add <remote_name> <remote_url>
  • <remote_name>:要添加的远程仓库的名称。通常,远程仓库的名称为 origin,但你也可以自定义一个名称。
  • <remote_url>:远程仓库的 URL。它可以是一个指向远程 Git 仓库的 HTTPS、SSH 或 Git 协议链接。

以下命令将向当前 Git 仓库添加一个名为 origin 的远程仓库,它的 URL 是 https://github.com/user/repo.git。

git remote add origin https://github.com/user/repo.git

==================================

 

==================================

 

posted @   emanlee  阅读(890)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2023-05-22 CT 计算器官体积
2023-05-22 CT影像文件格式 dicom pydicom
2023-05-22 dicom 图像分割
2023-05-22 ImportError: cannot import name 'QuantStub' from 'torch.ao.quantization' (E:\Eprogramfiles\Anaconda3\lib\site-packages\torch\ao\quantization\__init__.py)
2023-05-22 MySQL 查询数据库表的数量
2023-05-22 Oracle 查询数据库表的数量
2022-05-22 python 下划线和双下划线
点击右上角即可分享
微信分享提示