Fetch the repository succeeded.
This action will force synchronization from zhengqingya/shell, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#!/bin/bash
####################################
# @description git仓库迁移(所有分支)
# @params $? => 代表上一个命令执行后的退出状态: 0->成功,1->失败
# ${1} => 脚本第1个参数:旧仓库地址.git
# ${2} => 脚本第2个参数:新仓库地址.git
# @example => sh git-move.sh https://gitee.com/zhengqingya/docker-compose.git https://github.com/zhengqingya/docker-compose.git
# @author zhengqingya
# @date 2022/6/15 16:01
####################################
# 在执行过程中若遇到使用了未定义的变量或命令返回值为非零,将直接报错退出
set -eu
# 检查参数个数
if [ "${#}" -lt 2 ]; then
echo "\033[41;37m 脚本使用示例: sh git-move.sh https://gitee.com/zhengqingya/docker-compose.git https://github.com/zhengqingya/docker-compose.git \033[0m"
exit
fi
echo "****** 拉取旧仓库地址: ${1}"
git clone --bare ${1}
echo "****** 进入仓库名称: ${1##*/}"
cd ${1##*/}
echo "****** 迁移到新仓库地址:${2}"
git push --mirror ${2}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。