git remote增删改查远程仓库的简写和对应地址

前端之家收集整理的这篇文章主要介绍了git remote增删改查远程仓库的简写和对应地址前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

查看

$ git remote -v = --verbose(冗长的) 记忆方法:also显示冗长版本的地址,即完整url,而非alias
origin (fetch)
origin
(push)
注:可以有多个远程仓库。

add

git remote add [-t ] [-m ] [-f] [--[no-]tags] [--mirror=]
$ git remote add pb

修改简写的对应URL

方式一:
git remote set-url origin ​【new_remote_repository_address】

方式二:先删除后新建
project_name> git remote remove origin
project_name> git remote add origin【new_remote_repository_address】 #添加一个远程仓库地址

修改URL对应的简写

*git remote show 看到更多的信息。

$ git remote show origin

列出了哪些远程分支不在你的本地,哪些远程分支已经从服务器上移除了,还有当你执行 git pull 时哪些分支会自动合并。

猜你在找的Git相关文章