代码拉取完成,页面将自动刷新
#!/bin/bash
# git checkout master
# git checkout multiple_push push.sh
# git reset HEAD
# chmod +x push.sh
# ./push.sh
# set remote osc
osc_exists=false
for remote in `git remote`; do
if [[ $remote == "osc" ]]; then
osc_exists=true
break
fi
done
if [[ $osc_exists == false ]]; then
# git remote add osc https://git.oschina.net/zam1024t/LocalizedMenu
git remote add osc https://gitee.com/zam1024t/LocalizedMenu
fi
# set remote coding
coding_exists=false
for remote in `git remote`; do
if [[ $remote == "coding" ]]; then
coding_exists=true
break
fi
done
if [[ $coding_exists == false ]]; then
git remote add coding https://coding.net/zam1024t/LocalizedMenu
fi
git checkout master
if [[ `git diff --name-only` != '' ]]; then
echo 'Has uncommit changes.'
exit 0
fi
lastcommit=`git log -n 1 --pretty=format:"%H"`
# push to oschina
read -p "Start set shots for oschina... (press any key to continue, wait 9s)" -t 9 -n 1
git push osc master -f
sed -i 's/<br>//g' *.md
sed -i 's/<br>//g' readme/*.md
sed -i 's/raw.githubusercontent.com\/zam1024t\/LocalizedMenu/gitee.com\/zam1024t\/LocalizedMenu\/raw/g' *.md
sed -i 's/raw.githubusercontent.com\/zam1024t\/LocalizedMenu/gitee.com\/zam1024t\/LocalizedMenu\/raw/g' readme/*.md
git commit -m"set shots for oschina" .
git push osc master
read -p "set shots for oschina, Done. (press any key to continue, wait 9s)" -t 9 -n 1
# clean changes
git reset $lastcommit
git checkout .
echo 'All done.'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。