Add custom git commands
This commit is contained in:
parent
ceb01ff80c
commit
295dd570c7
2 changed files with 117 additions and 0 deletions
bin
11
bin/git-publish
Executable file
11
bin/git-publish
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/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}");
|
Loading…
Add table
Add a link
Reference in a new issue