Last active
December 9, 2016 09:30
-
-
Save shamrin/afd859cfb6cc786aa7e3 to your computer and use it in GitHub Desktop.
ffmerge and ffrebase: merge in fast-forward-only single-commit workflow
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
#!/usr/bin/env fish | |
set branch (git symbolic-ref -q --short HEAD) | |
or exit 1 | |
if test $branch = "master" | |
echo "error: can't ffmerge master to master, switch to feature branch first" | |
exit 2 | |
end | |
set commands \ | |
"git checkout master" \ | |
"git merge --ff-only origin/master" \ | |
"git merge --ff-only $branch" \ | |
"git push origin master:master" | |
for command in $commands | |
echo "# $command" | |
eval $command | |
or exit 3 | |
end |
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
#!/usr/bin/env fish | |
set branch (git symbolic-ref -q --short HEAD) | |
or exit 1 | |
if test $branch = "master" | |
echo "error: can't ffrebase master to master, switch to feature branch first" | |
exit 2 | |
end | |
set commands \ | |
"git fetch" \ | |
"git rebase origin/$branch" \ | |
"git rebase -i origin/master" \ | |
"git push origin +$branch:$branch" | |
for command in $commands | |
echo "# $command" | |
eval $command | |
or exit 3 | |
end | |
echo "Done. Review changes and run ffmerge" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment