summaryrefslogtreecommitdiff
path: root/git-remote.perl
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2007-02-19 04:00:00 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-20 02:34:33 (GMT)
commit1e592d65b50dbec87fde9f4ef1b7fd8d90bf7b8c (patch)
treeab3514af964cda2bdd08b64bb1c5eb05342affd7 /git-remote.perl
parent0bce7a52f2b723bf6717be2951df7c0a49337592 (diff)
downloadgit-1e592d65b50dbec87fde9f4ef1b7fd8d90bf7b8c.zip
git-1e592d65b50dbec87fde9f4ef1b7fd8d90bf7b8c.tar.gz
git-1e592d65b50dbec87fde9f4ef1b7fd8d90bf7b8c.tar.bz2
Teach git-remote to update existing remotes by fetching from them
This allows users to use the command "git remote update" to update all remotes that are being tracked in the repository. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-remote.perl')
-rwxr-xr-xgit-remote.perl13
1 files changed, 13 insertions, 0 deletions
diff --git a/git-remote.perl b/git-remote.perl
index c56c5a8..6e473ec 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -303,6 +303,18 @@ elsif ($ARGV[0] eq 'show') {
show_remote($ARGV[$i], $ls_remote);
}
}
+elsif ($ARGV[0] eq 'update') {
+ my $conf = $git->config("remote.fetch");
+ if (defined($conf)) {
+ @remotes = split(' ', $conf);
+ } else {
+ @remotes = sort keys %$remote;
+ }
+ for (@remotes) {
+ print "Fetching $_\n";
+ $git->command('fetch', "$_");
+ }
+}
elsif ($ARGV[0] eq 'prune') {
my $ls_remote = 1;
my $i;
@@ -360,5 +372,6 @@ else {
print STDERR " git remote add <name> <url>\n";
print STDERR " git remote show <name>\n";
print STDERR " git remote prune <name>\n";
+ print STDERR " git remote update\n";
exit(1);
}