代码拉取完成,页面将自动刷新
#!/bin/bash
#
# Author: Long Zhu <iprintf@qq.com>
# Date: 2016-10-16 02:09
# Location: ShenZhen Home
# Desc: 实现git-shadow-remove命令
#
get_remote_branch() {
for r in $(git remote)
do
rb=$(echo $(git branch | grep "cipher-$r" 2> /dev/null))
if test ! -z "$rb" ; then
echo "$r $rb"
return
fi
done
}
delete_remote_branch() {
remote_branch=$(get_remote_branch)
test -z "$remote_branch" && return
remote=${remote_branch%% *}
branch=${remote_branch#* }
url=$(git remote get-url $remote)
test -z "$url" && return
git remote remove $remote
git remote add $remote $url
git branch -D $branch
}
delete_cipher_branch() {
branch=$(echo $(git branch | grep "cipher"))
test -z "$branch" && return
git branch -D $branch
}
delete_config_dir() {
config_dir=.git/shadow
test -e $config_dir && rm $config_dir -rf &> /dev/null
}
delete_remote_branch
delete_cipher_branch
delete_config_dir
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。