mirror of
https://gitlab.com/JKANetwork/jka-toolkit.git
synced 2026-02-15 17:41:31 +01:00
add option, update before change branch
This commit is contained in:
@@ -8,7 +8,7 @@ preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ")
|
|||||||
if [ $preOption = "Not" ];then #When it isn't only it can do git clone
|
if [ $preOption = "Not" ];then #When it isn't only it can do git clone
|
||||||
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo repo (Hacer clone)" i "Inicializar nuevo repo"`
|
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo repo (Hacer clone)" i "Inicializar nuevo repo"`
|
||||||
else #Else, all other options
|
else #Else, all other options
|
||||||
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"`
|
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" n "Crear nueva rama" b "Cambiar de rama " u "Cambiar de rama y actualizar" m "Unir ramas (Hacer merge)"`
|
||||||
actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch
|
actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch
|
||||||
actual2=$(git branch --list | grep "^*" | cut -f2 -d" ") #Current branch name
|
actual2=$(git branch --list | grep "^*" | cut -f2 -d" ") #Current branch name
|
||||||
fi
|
fi
|
||||||
@@ -65,7 +65,7 @@ if [ ! -z $gitopt ];then #No canceled
|
|||||||
fi
|
fi
|
||||||
git add . && git commit -m "$commit"
|
git add . && git commit -m "$commit"
|
||||||
;;
|
;;
|
||||||
"b")
|
"b" | "u")
|
||||||
j=0
|
j=0
|
||||||
rama=""
|
rama=""
|
||||||
#Loop to create dialog whith all branches (except the current)
|
#Loop to create dialog whith all branches (except the current)
|
||||||
@@ -80,7 +80,7 @@ if [ ! -z $gitopt ];then #No canceled
|
|||||||
error=0 #If 1 aux is yet in lista array
|
error=0 #If 1 aux is yet in lista array
|
||||||
for (( i=0;i<${#lista[@]} && error==0;i++ ))
|
for (( i=0;i<${#lista[@]} && error==0;i++ ))
|
||||||
do
|
do
|
||||||
if [ $aux = ${lista[$i]} -o $aux = $actual2 ];then
|
if [ $aux =s ${lista[$i]} -o $aux = $actual2 ];then
|
||||||
error=1
|
error=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -97,6 +97,9 @@ if [ ! -z $gitopt ];then #No canceled
|
|||||||
ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama`
|
ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama`
|
||||||
if [ ! -z $ramificacion ];then
|
if [ ! -z $ramificacion ];then
|
||||||
git checkout ${lista[$ramificacion]}
|
git checkout ${lista[$ramificacion]}
|
||||||
|
if [ $gitopt = "u" ];then
|
||||||
|
git pull origin ${lista[$ramificacion]}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"n")
|
"n")
|
||||||
|
|||||||
Reference in New Issue
Block a user