代码拉取完成,页面将自动刷新
#!/bin/sh
# @brief tiny tool used to manger project
# @file repos.sh
# @author xiyanxiyan10
# @CreatedTime 2014/09/27
# @LastChanged 2014/09/27
case "$1" in
"record" )
git commit -a
;;
"pull" )
git pull origin master
;;
"push" )
git push
;;
"changelog" )
git log --oneline
;;
"checkout" )
git checkout -- .
;;
"revert" )
git revert ${2}
;;
"add_remote" )
git remote add ${2} git@github.com:${2}/${3}.git
;;
"pull_remote" )
git remote add ${2} git@github.com:${2}/${3}.git || git fetch ${2} && git merge ${2}/master
;;
"fetch" )
git fetch ${2}
;;
"merge" )
git merge ${2}/master
;;
"show_remote" )
git remote -v
;;
"tag" )
git tag -a ${2}
;;
"pushtag" )
git push git@github.com:${2}/${3}.git --tag
;;
"clean" )
find -name '*.out' |xargs rm
find -name 'cscope.*' |xargs rm
find -name 'tags' |xargs rm
find -name '*.so' |xargs rm
find -name '*.o' |xargs rm
find -name '*.a' |xargs rm
find -name '*.d' |xargs rm
find -name '*.pyc' |xargs rm
;;
"review")
cscope -bqR
ctags -R *
;;
"replace")
${2} | xargs perl -pi -e \'${3}\'
;;
* )
echo "Help"
echo "./repos.sh record => record patch"
echo "./repos.sh pull => pull patch"
echo "./repos.sh push => push patch"
echo "./repos.sh changelog => show changelog"
echo "./repos.sh checkout => revert change code"
echo "./repos.sh revert => revert patch by id"
echo "./repos.sh add_remote => add new remote"
echo "./repos.sh fetch => fetch from remote"
echo "./repos.sh merge => merge from remote"
echo "./repos.sh pull_remote => pull from remote"
echo "./repos.sh show_remote => show remote"
echo "./repos.sh tag => tag version"
echo "./repos.sh pushtag => push tag"
echo "./repos.sh clean => clean project"
echo "./repos.sh review => review project"
echo "./repos.sh [cmd] [replace pattern] => change some pattern matched in matched file"
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。