Git查看远程仓库地址

命令:

1
git remote -v

e.g.

1
2
3
4
# 查看远程仓库地址
git remote -v
origin http://gogs.linjiangxiong.com/ljx/devops-doc.git (fetch)
origin http://gogs.linjiangxiong.com/ljx/devops-doc.git (push)

Git修改远程仓库地址

命令:

1
git remote set-url origin new.git.url/here

e.g.

1
2
3
4
5
6
7
# 将远程仓库地址改为 HTTPS 协议
git remote set-url origin https://gogs.linjiangxiong.com/ljx/devops-doc.git

# 查看修改后的地址
git remote -v
origin https://gogs.linjiangxiong.com/ljx/devops-doc.git (fetch)
origin https://gogs.linjiangxiong.com/ljx/devops-doc.git (push)

(END)