html tool

2022年9月7日星期三

git 提交url转换

 来源:https://docs.github.com/cn/get-started/getting-started-with-git/managing-remote-repositories

  1. 列出现有远程仓库以获取要更改的远程仓库的名称。
    $ git remote -v
    > origin  git@github.com:USERNAME/REPOSITORY.git (fetch)
    > origin  git@github.com:USERNAME/REPOSITORY.git (push)
  2. 使用 git remote set-url 命令将远程 URL 从 SSH 更改为 HTTPS。
    $ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
  3. 验证远程 URL 是否已更改。
    $ git remote -v
    # Verify new remote URL
    > origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
    > origin  https://github.com/USERNAME/REPOSITORY.git (push)

没有评论:

发表评论