diff options
Diffstat (limited to 'gitdit')
-rw-r--r-- | gitdit | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/gitdit b/gitdit deleted file mode 100644 index 1b80a97f920d..000000000000 --- a/gitdit +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# gitdit, a dialog interface to manage git repositories -# Author: JKA Network - contacto@jkanetwork.com - -VERSION="0.2.3" -#First check if the user is in a git repository -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 - 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 - 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)"` - actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch -fi -if [ ! -z $gitopt ];then #No canceled - case $gitopt in - #Not staying in a git repo - "i") - git init - ;; - "c") - giturl=`dialog --stdout --inputbox "URL del git" 10 60` - if [ -z $giturl ];then - echo "NingĂșn repositorio especificado" - exit - fi - git clone $giturl - ;; - #Staying in a git repo - "p") - git pull $actual;; - "s") - estado=$(git status | grep "^Changes" ) #It need to commit something? - if [ $estado ];then #When is necesary commit - commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` - if [[ -z $commit ]];then - commit="changes" - fi - git add . && git commit -m "$commit" && git push $actual - else #Nothing to commit, only push - git push $actual - fi - ;; - "t") - commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` - if [[ -z $commit ]];then - commit="changes" - fi - git add . && git commit -m "$commit" - ;; - "b") - j=0 - rama="" - #Loop to create dialog whith all branches (except the current) - for i in $(git branch --list | grep "^*" -v ) - do - if [ $i != "*" ];then - rama="$rama $j $i" - lista[$j]=$i #Array with the names of branches - let j++ - fi - done - ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama` - if [ ! -z $ramificacion ];then - git checkout ${lista[$ramificacion]} - fi - ;; - "n") - NewBranch=`dialog --stdout --inputbox "Nombre de la nueva rama" 10 50 "new branch"` - if [ ! -z $NewBranch ];then - git checkout -b $NewBranch - fi - ;; - "m") - j=0 - rama="" - for i in $(git branch --list | grep "^*" -v ) - do - if [ $i != "*" ];then - rama="$rama $j $i" - lista[$j]=$i - let j++ - fi - done - merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir a $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama` - if [ ! -z $merges ];then - git merge ${lista[$merges]} - git push - fi - ;; - esac -fi
\ No newline at end of file |