Created
November 20, 2018 11:24
-
-
Save jjrscott/91371ee9ab1c3812ca4d3a3dc4be1c81 to your computer and use it in GitHub Desktop.
Commits and pushes EVERYTHING. Useful for pair programming and using git as a syncing mechanism
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use Getopt::Long; | |
warn "Stage\n"; | |
qx(git add -A -v); | |
warn "Commit\n"; | |
qx(git commit -a --allow-empty-message -m '' -v); | |
# my $logLines = qx(git log --pretty="format:%h %D" `git rev-list -g --all`); | |
# | |
# foreach my $logLine (split /\n/, $logLines) | |
# { | |
# my ($commit) = $logLine =~ m~^([A-F0-9]+)~i; | |
# if ($logLine !~ m~tag: \$/${commit}~) | |
# { | |
# printf qq(Tagging %s\n), $commit; | |
# system "git", "tag", "-a", '$/'.$commit, $commit, "-m", ""; | |
# } | |
# } | |
if (qx(git remote)) | |
{ | |
warn "Push\n"; | |
qx(git push --all -v); | |
warn "Push tags\n"; | |
qx(git push --tags -v); | |
warn "Fetch\n"; | |
qx(git fetch --all -v); | |
exit 0; | |
} | |
else | |
{ | |
warn "No remotes\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment