Commit 1c422eb1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

ginit/gpull/gpush: add support git.somename in the first param

parent 1a85f215
......@@ -12,9 +12,12 @@ if [ "$1" = "-h" ] ; then
exit 1
fi
[ -n "$1" ] && GIRARHOST=$1
if is_girar_name $1 ; then
GIRARHOST=$1
shift
fi
PROJECTNAME=$(basename `pwd`)
echo "Create remote $PROJECTNAME repo"
echo "Create remote $PROJECTNAME repo in $GIRARHOST:"
ssh $GIRARHOST git-init-db $PROJECTNAME.git
git remote add origin $GIRARHOST:packages/$PROJECTNAME.git
......@@ -5,8 +5,14 @@
if [ "$1" = "-h" ] ; then
echo "gpull [args] - do git pull --rebase"
echo "Use: ginit without parameters"
echo "Use: gpull without parameters"
exit 1
fi
if is_girar_name $1 ; then
GIRARHOST=$1
shift
fi
echo "Pull repo from $GIRARHOST"
git pull --rebase $@
......@@ -6,7 +6,7 @@
#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec
if [ "$1" = "-h" ] ; then
echo "gpush - publish current project repo to $GIRARHOST"
echo "gpush - publish current project repo remote git repo"
echo "Use: gpush [-f|--force] [-a|--all] [project name] [target branch]"
exit 1
fi
......@@ -23,6 +23,11 @@ if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then
shift
fi
if is_girar_name $1 ; then
GIRARHOST=$1
shift
fi
# use as project name
if [ -n "$1" ] ; then
PROJECTNAME=$1
......@@ -49,6 +54,7 @@ else
#[ -n "$PUSHALL" ] || TARGETBRANCH=master
fi
echo "Push $PROJECTNAME.git to $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH"
git push $PUSHALL $PUSHFORCE $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH
git push --tags $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment