forked from jwiegley/git-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from honzakuzel1989/git-done-merge-release
More usefull scripts for daily work
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# git branch-done <branch> | ||
|
||
# destination branch as parameter - depends on merge strategy, typically master | ||
DST_BRANCH="" | ||
if [ ! -z "$1" ]; then | ||
DST_BRANCH="$1" | ||
else | ||
echo "Usage: git branch-done <branch>" | ||
exit 1 | ||
fi | ||
|
||
# get current branch - typically topic branch like taskXXXX, bugXXXX, ... | ||
cb=`git rev-parse --abbrev-ref HEAD` | ||
# no fast forward merge from current branch to destination branch | ||
git checkout $DST_BRANCH && git merge --no-ff $cb && git branch -d $cb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# git merge-to <branch> | ||
|
||
# destination branch as parameter - depends on merge strategy, typically release | ||
DST_BRANCH="" | ||
if [ ! -z "$1" ]; then | ||
DST_BRANCH="$1" | ||
else | ||
echo "Usage: git merge-to <branch>" | ||
exit 1 | ||
fi | ||
|
||
# get current branch - typically master or develop | ||
cb=`git rev-parse --abbrev-ref HEAD` | ||
# no fast forward merge from current branch to destination branch | ||
git checkout $DST_BRANCH && git merge --ff $cb && git co $cb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# git release <branch> | ||
|
||
# destination branch as parameter - depends on merge strategy, typically release | ||
DST_BRANCH="" | ||
if [ ! -z "$1" ]; then | ||
DST_BRANCH="$1" | ||
else | ||
echo "Usage: git release <branch>" | ||
exit 1 | ||
fi | ||
|
||
# get current branch - typically master or develop | ||
cb=`git rev-parse --abbrev-ref HEAD` | ||
# push current branch, pull destination branch, fast forward merge from current branch to destination branch, push and return | ||
git push && git checkout $DST_BRANCH && git pull && git merge --ff $cb && git push && git checkout $cb |