瀏覽代碼

202511211224

develop
Thibaud 1 月之前
父節點
當前提交
85afb168dd
共有 6 個文件被更改,包括 32 次插入47 次删除
  1. +0
    -20
      git_00_checkout_branch.sh
  2. +4
    -9
      git_03_push_branch.sh
  3. +3
    -8
      git_05_delete_feature_branch.sh
  4. +15
    -0
      git_98_checkout.sh
  5. +1
    -6
      git_99_status.sh
  6. +9
    -4
      mygitflow

+ 0
- 20
git_00_checkout_branch.sh 查看文件

@ -1,20 +0,0 @@
#!/bin/env bash
git_current_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
CUR_BRANCH=`git_current_branch`
CIBLE=$1
if [ "$CIBLE" == "" ]
then
CIBLE=$CUR_BRANCH
fi
git_01_quick_commit.sh
if [ ! "$CIBLE" = "$CUR_BRANCH" ];
then
git checkout $CIBLE
git pull
fi

+ 4
- 9
git_03_push_branch.sh 查看文件

@ -1,26 +1,21 @@
#!/bin/env bash
git_current_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
CUR_BRANCH=`git_current_branch`
CIBLE=$1
if [ "$CIBLE" == "" ]
then
CIBLE=$CUR_BRANCH
CIBLE=$GIT_CURRENT_BRANCH
fi
git_01_quick_commit.sh
if [ ! "$CIBLE" = "$CUR_BRANCH" ];
if [ ! "$CIBLE" = "$GIT_CURRENT_BRANCH" ];
then
git_00_checkout_branch.sh $CIBLE
fi
git push all
if [ ! "$CIBLE" = "$CUR_BRANCH" ];
if [ ! "$CIBLE" = "$GIT_CURRENT_BRANCH" ];
then
git_00_checkout_branch.sh $CUR_BRANCH
git_00_checkout_branch.sh $GIT_CURRENT_BRANCH
fi

+ 3
- 8
git_05_delete_feature_branch.sh 查看文件

@ -1,14 +1,9 @@
#!/bin/env bash
git_current_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
CUR_BRANCH=`git_current_branch`
CIBLE=$1
if [ "$CIBLE" == "" ]
then
CIBLE=$CUR_BRANCH
CIBLE=$GIT_CURRENT_BRANCH
fi
internal_delete_branch() {
@ -27,7 +22,7 @@ delete_branch() {
git_03_push_branch.sh
if [ ! "$CUR_BRANCH" = "develop" ]
if [ ! "$GIT_CURRENT_BRANCH" = "develop" ]
then
echo "La branche actuelle n'est pas develop"
read -p "Voulez-vous basculer sur develop ? " -n 1 -r
@ -39,7 +34,7 @@ then
fi
case $CIBLE in
($CUR_BRANCH) echo "Impossible : $CIBLE is current branch !";;
($GIT_CURRENT_BRANCH) echo "Impossible : $CIBLE is current branch !";;
("evo"*) delete_branch $CIBLE;;
("ano"*) delete_branch $CIBLE;;
(*) echo "$CIBLE is not a feature branch";;

+ 15
- 0
git_98_checkout.sh 查看文件

@ -0,0 +1,15 @@
#!/bin/env bash
CIBLE=$1
if [ "$CIBLE" == "" ]
then
CIBLE=$GIT_CURRENT_BRANCH
fi
git_01_quick_commit.sh
if [ ! "$CIBLE" = "$GIT_CURRENT_BRANCH" ];
then
git checkout $CIBLE
git pull
fi

git_00_status.sh → git_99_status.sh 查看文件

@ -1,14 +1,9 @@
#!/bin/env bash
git_current_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
CUR_BRANCH=`git_current_branch`
TEST=`git status | grep propre | wc -l`
if [ $TEST -eq 0 ]
then
echo "La branche actuelle ($CUR_BRANCH) n'est pas propre"
echo "La branche actuelle ($GIT_CURRENT_BRANCH) n'est pas propre"
echo # (optional) move to a new line
read -p "Voulez-vous voir les modifications courantes ? " -n 1 -r

+ 9
- 4
mygitflow 查看文件

@ -1,9 +1,14 @@
#!/bin/env bash
git_parse_branches() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
git_current_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
export GIT_CURRENT_BRANCH="$(git_parse_branches)"
}
export CUR_BRANCH=`git_current_branch`o
git_current_branch
usage(){
echo
@ -22,8 +27,8 @@ GITCMD=$1
shift
case $GITCMD in
("checkout") git_00_checkout_branch.sh $@;;
("status") git_00_status.sh $@;;
("checkout") git_98_checkout_branch.sh $@;;
("status") git_99_status.sh $@;;
("commit") git_01_quick_commit.sh $@;;
("add") git_02_add_branch.sh $@;;
("push") git_03_push_branch.sh $@;;

Loading…
取消
儲存