dotfiles/bin/git-publish

12 lines
280 B
PHP
Executable file

#!/usr/bin/env php
<?php
$currentBranch = exec('git rev-parse --abbrev-ref HEAD');
if (in_array($currentBranch, ['master', 'develop', 'staging'])) {
print "Currently on ${currentBranch}. Aborting.";
exit(1);
}
exec("git push -u origin ${currentBranch}:${currentBranch}");