Skip to content

Instantly share code, notes, and snippets.

@rgomezcasas
Last active June 16, 2020 07:14
Show Gist options
  • Save rgomezcasas/eea8639c3b316b58bde3378d46a8ea69 to your computer and use it in GitHub Desktop.
Save rgomezcasas/eea8639c3b316b58bde3378d46a8ea69 to your computer and use it in GitHub Desktop.
TCR
# -----------
# Explanation
mkdir tmp
echo "exit 0" > test
./test && echo "commit" || echo "revert"
# Should output "commit"
echo "exit 1" > test
./test && echo "commit" || echo "revert"
# Should output "revert"
# -----------
# PHP Example
alias test='./vendor/bin/phpunit'
alias commit='git commit -a'
alias revert='git commit -am wip; git reset --hard'
test && commit || revert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment