git-config 740 B

1234567891011121314151617181920212223242526
  1. git config --global url."http://chat.unix5.com/mudclient/".insteadOf "https://github.com/mudclient/"
  2. # 原始仓库 URL 列表
  3. urls=(
  4. "https://github.com/junegunn/vim-plug"
  5. "https://github.com/dzpao/vim-mbs"
  6. "https://github.com/morhetz/gruvbox"
  7. "https://github.com/yegappan/mru"
  8. "https://github.com/jlanzarotta/BufExplorer"
  9. "https://github.com/mhinz/vim-startify"
  10. )
  11. # 固定前缀
  12. prefix="http://chat.unix5.com/dzp"
  13. # 循环处理每个 URL
  14. for url in "${urls[@]}"; do
  15. # 提取仓库名称(去掉 .git 后缀)
  16. repo_name=$(basename "$url" .git)
  17. # 生成替换后的 URL
  18. replacement_url="$prefix/$repo_name"
  19. # 生成并执行 git config 命令
  20. git config --global url."$replacement_url".insteadOf "$url"
  21. done