git remote 命令

git remote 命令

git remote 命令用于在远程仓库的操作。


origin 为远程地址的别名。

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

git remote show [remote]

例如:

$ git remote show https://github.com/tianqixin/runoob-git-test
* remote https://github.com/tianqixin/runoob-git-test
  Fetch URL: https://github.com/tianqixin/runoob-git-test
  Push  URL: https://github.com/tianqixin/runoob-git-test
  HEAD branch: master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

```c
添加远程版本库:

git remote add [shortname] [url]
shortname 为本地的版本库,例如:

# 提交到 Github
$ git remote add origin git@github.com:tianqixin/runoob-git-test.git
$ git push -u origin master
其他相关命令:

git remote rm name  # 删除远程仓库
git remote rename old_name new_name  # 修改仓库名

在学习git的时候。发现当添加了远程产库地址时发现老师告诉的代码只告诉了怎么添加和修改,却没有告诉怎么删除。这里告诉大家删除远程库的话用 git remote rm name.
蟹蟹大家…

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值