1 Star 0 Fork 0

金凯 / tinysql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
checkout-pr-branch.sh 708 Bytes
一键复制 编辑 原始数据 按行查看 历史
Yiding Cui 提交于 2020-04-30 02:41 . init final course status
#!/usr/bin/env bash
# This script is used to checkout a TiDB PR branch in a forked repo.
if test -z $1; then
echo -e "Usage:\n"
echo -e "\tcheckout-pr-branch.sh [github-username]:[pr-branch]\n"
echo -e "The argument can be copied directly from github PR page."
echo -e "The local branch name would be [github-username]/[pr-branch]."
exit 0;
fi
username=$(echo $1 | cut -d':' -f1)
branch=$(echo $1 | cut -d':' -f2)
local_branch=$username/$branch
fork="https://github.com/$username/tidb"
exists=`git show-ref refs/heads/$local_branch`
if [ -n "$exists" ]; then
git checkout $local_branch
git pull $fork $branch:$local_branch
else
git fetch $fork $branch:$local_branch
git checkout $local_branch
fi
Go
1
https://gitee.com/jinkai719/tinysql.git
git@gitee.com:jinkai719/tinysql.git
jinkai719
tinysql
tinysql
course

搜索帮助