Skip to content

Instantly share code, notes, and snippets.

@jjrscott
Created November 20, 2018 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjrscott/91371ee9ab1c3812ca4d3a3dc4be1c81 to your computer and use it in GitHub Desktop.
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
#!/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