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

Git操作:远程仓库(git remote)的添加、管理和删除

时间:2020-04-03 11:48:29      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:repo   push   git操作   展示   xxx   div   add new   一个   nbsp   

这是你的git仓库,他已经添加了一个远程仓库,可以用git remote -v查看绑定的仓库列表,他会以<仓库名>  <仓库地址>的形式展示出来(一个仓库会显示两遍):

$ git remote -v
origin  https://xxx.com/lyj00912/xxx.git (fetch)
origin  https://xxx.com/lyj00912/xxx.git (push)

如果要删除一个仓库,可以用git remote remove <仓库名>来删除这个仓库:

$ git remote remove origin

删除之后再查看git remote -v,就会发现仓库已经被删除,列表为空:

$ git remote -v

如果要添加新的仓库,使用git remote add <仓库名> <仓库地址>来添加:

$ git remote add newrepo https://xxx.com/lyj00912/xxx.git

添加之后再查看git remote -v,就会发现仓库已经添加进去了:

$ git remote -v
newrepo   https://xxx.com/lyj00912/xxx.git (fetch)
newrepo   https://xxx.com/lyj00912/xxx.git (push)

 

Git操作:远程仓库(git remote)的添加、管理和删除

标签:repo   push   git操作   展示   xxx   div   add new   一个   nbsp   

原文地址:https://www.cnblogs.com/lyj00912/p/12625204.html

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