Created
July 30, 2014 19:56
-
-
Save Elzair/b4312a1466b0331ba765 to your computer and use it in GitHub Desktop.
Git Process Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git fetch && git checkout development && git rebase -p origin/development && git checkout -b $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git fetch && git checkout master && git rebase -p origin/master && git checkout -b hotfix-$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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