Skip to content

Instantly share code, notes, and snippets.

@mgershovitz mgershovitz/git_wrapper
Last active Dec 15, 2019

Embed
What would you like to do?
#!/bin/bash
function git {
if [[ "$1" = "merge" && "$@" != *"--help"* && "$@" != *"--abort"* ]]; then
git_merge_wrapper "$@";
else
command git "$@"
fi
}
function git_merge_wrapper {
command git "$@"
ret_code=$?
if [[ "$ret_code" != 0 ]]; then
command git merge --abort
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.