Skip to content

Instantly share code, notes, and snippets.

@Elzair
Created July 30, 2014 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elzair/b4312a1466b0331ba765 to your computer and use it in GitHub Desktop.
Save Elzair/b4312a1466b0331ba765 to your computer and use it in GitHub Desktop.
Git Process Scripts
#!/bin/sh
git fetch && git checkout development && git rebase -p origin/development && git checkout -b $1
#!/bin/sh
git fetch && git checkout master && git rebase -p origin/master && git checkout -b hotfix-$1
#!/bin/sh
if $(test $2 = "master"); then
semver=$(echo $3 | grep -E "^([[:digit:]]+\\.)?([[:digit:]]+\\.)?([[:digit:]]+)$")
if $(test $semver = ""); then
echo "Invalid tag: "$1$3 > /dev/stderr && exit 1
fi
fi
git fetch && git checkout $2 && git rebase -p origin/$2 && git merge --no-ff $1 && git push
if $(test $2 = "master"); then
git tag $1$3 && git push --tags && git branch -D $1 && git push origin :$1
fi
#!/bin/sh
git checkout master && git merge --no-ff hotfix-$1 && git checkout development && git rebase -p origin/development && git merge --no-ff hotfix-$1 && git branch -D hotfix-$1 && git push origin :hotfix-$1
#!/bin/sh
locals=$(git branch | sed -e "s/\s\|*//g")
remotes=$(git branch -a | grep remotes | awk '{ print substr($1,16); }')
branch=$1
for i in $locals; do
if $(test $i = $branch); then
l=$i
fi
done
for j in $remotes; do
if $(test $j = $branch); then
r=$j
fi
done
git push -u origin $branch
if $(test $r = $l); then
git fetch && git checkout development && git rebase -p origin/development && git checkout $branch && git merge development
else
git fetch && git rebase -p origin/development
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment