dotfiles/bin/git-publish

12 lines
294 B
Plaintext
Raw Normal View History

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