git 提交的本地master库 描述可以修改吗

2025-05-16 17:35:46
推荐回答(1个)
回答1:

命令行:
git remote命令中有个子命令叫set-url。
文档如下:

git remote set-url [--push] []
git remote set-url --add [--push]
git remote set-url --delete [--push]

set-url
Changes URL remote points to. Sets first URL remote points to matching regex (first URL if no is given) to . If
doesn't match any URL, error occurs and nothing is changed.

With --push, push URLs are manipulated instead of fetch URLs.

With --add, instead of changing some URL, new URL is added.

With --delete, instead of changing some URL, all URLs matching regex are deleted. Trying to delete all non-push URLs is an error.

所以改远端url的命令应该是:

git remote set-url origin xxx.git