如何重新定位 git 仓库的 URL?

huangapple go评论55阅读模式
英文:

How to relocate the git-repo urls?

问题

I'm here to help with the translation. Here's the translated content:

我正在尝试为qca8081物理层构建驱动程序,并注意到它正在指向旧的CAF URL。这在我尝试执行repo sync时导致了问题。

根据他们的驱动程序构建指南,以下是CLI,但它不起作用。

repo init -u git://codeaurora.org/quic/qsdk/releases/manifest/qstak -b release -m caf_AU_LINUX_QSDK_NHSS.QSDK.8.0.1_TARGET_ALL.7.0.1681.673.032.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable

我可以将其更改为以下内容以通过该步骤:

repo init -u https://git.codelinaro.org/clo/qsdk/releases/manifest/qstak.git -b caf_migration/release -m caf_AU_LINUX_QSDK_NHSS.QSDK.8.0.1_TARGET_ALL.7.0.1681.673.032.xml

然而,以下第二步失败并显示错误

$ repo sync -j1 --no-tags -c
fatal: unable to access 'https://source.codeaurora.org/quic/qsdk/oss/tools/meta/': Received HTTP code 502 from proxy after CONNECT

**编辑-1:**根据@phd的回复,我尝试通过以下两个命令更改git配置,以及编辑所有内部存储库中的config文件。它们最终都要求我输入用户名/密码。

git config --global url.https://.insteadOf git://
git config --global url.https://git.codelinaro.org/clo/.insteadOf git://codeaurora.org/quic/

**附注:**如果这有关企业代理的话。

英文:

I'm trying to build driver for qca8081 phy and notice that it is pointing to old CAF URLs. That is causing problem when I tried to perform repo sync

per their driver build guide following is CLI, but it doesn't work.

repo init -u git://codeaurora.org/quic/qsdk/releases/manifest/qstak -b release -m caf_AU_LINUX_QSDK_NHSS.QSDK.8.0.1_TARGET_ALL.7.0.1681.673.032.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable

I could change this to following to pass that step,

repo init -u https://git.codelinaro.org/clo/qsdk/releases/manifest/qstak.git -b caf_migration/release -m caf_AU_LINUX_QSDK_NHSS.QSDK.8.0.1_TARGET_ALL.7.0.1681.673.032.xml

However, the following 2nd step fails with error.

$ repo sync -j1 --no-tags -c
fatal: unable to access 'https://source.codeaurora.org/quic/qsdk/oss/tools/meta/': Received HTTP code 502 from proxy after CONNECT

EDIT-1: per reply from @phd, I tried changing the git config via following two commands, as well as editing config file in all internal repositories. They both end-up asking me Username/password

git config --global url.https://.insteadOf git://
git config --global url.https://git.codelinaro.org/clo/.insteadOf git://codeaurora.org/quic/

Username for 'https://git.codelinaro.org':

P.S. I'm behind corporate proxy if that matters.

答案1

得分: 3

使用 git config --global url.<base>.insteadOf 在运行时替换URL:

git config --global url.https://git.codelinaro.org/clo/.insteadOf git://codeaurora.org/quic/

现在再尝试运行 repo sync

英文:

Use git config --global url.<base>.insteadOf to substitute URLs on the fly:

git config --global url.https://git.codelinaro.org/clo/.insteadOf git://codeaurora.org/quic/

Now try repo sync again.

答案2

得分: 2

repo包装了git,因此repo sync将依赖于每个存储库中Git配置的远程信息。

对于每个受影响的存储库,

  1. cd到存储库目录
  2. 运行git remote -v以列出当前远程信息;第一列是远程名称,第二列是URL
  3. 运行git remote set-url $REMOTE_NAME $NEW_URL
英文:

repo wraps git, so repo sync will rely on whatever remotes are configured within Git for each repository.

For each affected repository,

  1. cd to the repository directory
  2. git remote -v to list current remotes; the first column is the remote name, and the second is the URL
  3. git remote set-url $REMOTE_NAME $NEW_URL

huangapple
  • 本文由 发表于 2023年4月20日 01:11:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76057169.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定