Yifans_Z's Blog.

Git 修改远程仓库地址

字数统计: 104阅读时长: 1 min
2017/05/17 Share

查看当前的远程库

git remote -v

-v--verbose 的简写

origin ssh://ubuntu@168.8.1.1/usr/share/nginx/html (fetch)
origin ssh://ubuntu@168.8.1.1/usr/share/nginx/html (push)

添加远程仓库

git remote add [shortname] [url]

eg:

git remote add pb git://github.com/paulboone/ticgit.git

修改远程仓库

修改 url

git remote set-url [shortname] [new url]

修改 shortname

git remote rename [new shortname] [url]

删除远程仓库

git remote [shortname]

Reference:

CATALOG
  1. 1. 查看当前的远程库
  2. 2. 添加远程仓库
  3. 3. 修改远程仓库
    1. 3.1. 修改 url
    2. 3.2. 修改 shortname
  4. 4. 删除远程仓库