mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修改重置分支shell
This commit is contained in:
parent
6f2e7b9459
commit
f6dc0e020f
|
@ -324,8 +324,9 @@ git_pull_scripts() {
|
|||
set_proxy
|
||||
git fetch --all
|
||||
exit_status=$?
|
||||
git pull --allow-unrelated-histories
|
||||
git pull &>/dev/null
|
||||
unset_proxy
|
||||
reset_branch "$branch"
|
||||
|
||||
cd $dir_current
|
||||
}
|
||||
|
@ -342,14 +343,19 @@ reset_romote_url() {
|
|||
git remote set-url origin $url &>/dev/null
|
||||
|
||||
local part_cmd=""
|
||||
reset_branch "$branch"
|
||||
cd $dir_current
|
||||
fi
|
||||
}
|
||||
|
||||
reset_branch() {
|
||||
local branch="$1"
|
||||
if [[ $branch ]]; then
|
||||
part_cmd="origin/${branch}"
|
||||
git checkout -B "$branch"
|
||||
git branch --set-upstream-to=$part_cmd $branch
|
||||
fi
|
||||
git reset --hard $part_cmd &>/dev/null
|
||||
cd $dir_current
|
||||
fi
|
||||
}
|
||||
|
||||
random_range() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user