查看当前远端地址
$ git remote -v
origin ssh://[email protected]:29/ex.git (fetch)
origin ssh://[email protected]:29/ex.git (push)
修改新的远端地址
git remote set-url origin ssh://[email protected]:29/ex.git
验证修改结果
$ git remote -v
origin ssh://[email protected]:29/ex.git (fetch)
origin ssh://[email protected]:29/ex.git (push)
下来就可以Push最新修改
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
The authenticity of host '[git.jidan.org]:29 ([8.8.8.8]:29)' can't be established.
ED25519 key fingerprint is SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:6: [git.zjq.xyz]:29
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[git.jidan.org]:29' (ED25519) to the list of known hosts.
Enumerating objects: 39, done.
Counting objects: 100% (39/39), done.
Delta compression using up to 4 threads
Compressing objects: 100% (23/23), done.
Writing objects: 100% (23/23), 10.86 MiB | 3.13 MiB/s, done.
Total 23 (delta 4), reused 0 (delta 0), pack-reused 0 (from 0)
To ssh://git.jidan.org:29/ex.git
17ae34c..b8ae5da master -> master
Push Done!