Gitin: 一键从 Github、Gitee 和 Moeyy 下载或克隆仓库

Gitin 是一个简单的 Bash 脚本,可以帮助您从 Github、Gitee 和 Moeyy 下载或克隆仓库。它提供了一个便捷的命令行界面,简化了从不同平台获取代码的操作。

使用方法

gitin download/clone -github url1 -gitee url2 -moeyy url3

参数说明:

  • download/clone: 选择操作类型,download 用于下载仓库,clone 用于克隆仓库。
  • -github url1: Github 仓库地址
  • -gitee url2: Gitee 仓库地址
  • -moeyy url3: Moeyy 仓库地址

代码示例

gitin() {
     # 检查参数
     if [ $# -ne 7 ]; then
          echo '使用方法: gitin download/clone -github url1 -gitee url2 -moeyy url3'
          return 1
     fi
     # 解析参数 
     case $1 in
          download|Download|dow|Dow)
               wheregit=$2
               if [ "${wheregit}" = gitee ]; then
                    gitee_url=$4
                    wget -q --show-progress ${gitee_url}
               elif [ "${wheregit}" = github ]; then
                    github_url=$4
                    wget -q --show-progress ${github_url}
               elif [ "${wheregit}" = moeyy ]; then
                    moeyy_url=$4
                    wget -q --show-progress ${moeyy_url}
               fi
               ;;
          clone)
               wheregit=$2
               if [ "${wheregit}" = gitee ]; then
                    gitee_url=$4
                    git clone --depth=1 ${gitee_url}
               elif [ "${wheregit}" = github ]; then
                    github_url=$4
                    git clone --depth=1 ${github_url}
               elif [ "${wheregit}" = moeyy ]; then
                    moeyy_url=$4
                    git clone --depth=1 ${moeyy_url}
               fi
               ;;
     esac
}
          gitin clone -github https://github.com/yoimiya-kokomi/Miao-Yunzai.git -gitee https://gitee.com/yoimiya-kokomi/Miao-Yunzai.git -moeyy https://github.moeyy.xyz/https://github.com/yoimiya-kokomi/Miao-Yunzai.git

使用示例

# 从 Github 下载仓库
gitin download -github https://github.com/yoimiya-kokomi/Miao-Yunzai.git

# 从 Gitee 克隆仓库
gitin clone -gitee https://gitee.com/yoimiya-kokomi/Miao-Yunzai.git

# 从 Moeyy 下载仓库
gitin download -moeyy https://github.moeyy.xyz/https://github.com/yoimiya-kokomi/Miao-Yunzai.git

总结

Gitin 为您提供了一个便捷的方式,让您可以从 Github、Gitee 和 Moeyy 下载或克隆仓库。它可以节省您在不同平台之间切换的时间,并简化您的工作流程。

Gitin: 一键从 Github、Gitee 和 Moeyy 下载或克隆仓库

原文地址: https://www.cveoy.top/t/topic/o7Dg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录