feat(git): update merge-to to rebase onto target branch
Now when merging to it will rebase onto the target branch to make merge-to work more. I was finding that it will fail and I was doing the merge step all the time so now its built in.
This commit is contained in:
parent
7cf8c3fa53
commit
1e4968e1e1
1 changed files with 15 additions and 1 deletions
|
|
@ -14,8 +14,22 @@ main() {
|
||||||
local branch=$(git rev-parse --abbrev-ref HEAD);
|
local branch=$(git rev-parse --abbrev-ref HEAD);
|
||||||
echo "Merging $branch with $MERGE_BRANCH";
|
echo "Merging $branch with $MERGE_BRANCH";
|
||||||
|
|
||||||
|
#
|
||||||
|
# Ensure the target branch is up to date
|
||||||
|
#
|
||||||
|
git checkout $MERGE_BRANCH
|
||||||
|
git pull origin $MERGE_BRANCH
|
||||||
|
git checkout $branch
|
||||||
|
|
||||||
|
#
|
||||||
|
# Rebase onto branch so we don't create a merge commit
|
||||||
|
#
|
||||||
|
git rebase $MERGE_BRANCH;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Merge into the target branch ensuring its a fast forward merge
|
||||||
|
#
|
||||||
git checkout $MERGE_BRANCH;
|
git checkout $MERGE_BRANCH;
|
||||||
git pull origin $MERGE_BRANCH
|
|
||||||
git merge --ff-only --log $branch;
|
git merge --ff-only --log $branch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue