1 Star 0 Fork 0

输出自己/shadow-git

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
git-shadow-remove 1021 Bytes
一键复制 编辑 原始数据 按行查看 历史
输出自己 提交于 2016-10-16 03:11 . 增加git-shadow-remove命令
#!/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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/iprintf/shadow-git.git
git@gitee.com:iprintf/shadow-git.git
iprintf
shadow-git
shadow-git
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385