Skip to content

Commit

Permalink
feat(feature): checkout from start point if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpipy committed Nov 18, 2020
1 parent bf6bc13 commit e3fea7c
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions bin/git-feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ do
--squash )
merge_mode="--squash"
;;
--from )
start_point=$2
shift
;;
* )
argv+=($1)
;;
Expand All @@ -55,10 +59,24 @@ else
else
branch="$branch_prefix"/"${argv[0]}"
fi
if [[ -n $remote ]]

if [[ -n $remote ]] && [[ -z $start_point ]]
then
git create-branch -r $remote $branch
else
fi

if [[ -z $remote ]] && [[ -z $start_point ]]
then
git create-branch $branch
fi

if [[ -n $remote ]] && [[ -n $start_point ]]
then
git create-branch -r $remote --from $start_point $branch
fi

if [[ -z $remote ]] && [[ -n $start_point ]]
then
git create-branch --from $start_point $branch
fi
fi

0 comments on commit e3fea7c

Please sign in to comment.