summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0bce7a5)
raw | patch | inline | side by side (parent: 0bce7a5)
author | Theodore Ts'o <tytso@mit.edu> | |
Mon, 19 Feb 2007 04:00:00 +0000 (23:00 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 20 Feb 2007 02:34:33 +0000 (18:34 -0800) |
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>
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>
Documentation/config.txt | patch | blob | history | |
Documentation/git-remote.txt | patch | blob | history | |
git-remote.perl | patch | blob | history |
index 38655350f22bde08786b4a42e608ba76c1becea4..d8e696f4cd9f119d9368c08e91ccea9946c83b3b 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
pull.twohead::
The default merge strategy to use when pulling a single branch.
+remote.fetch::
+ The list of remotes which are fetched by "git remote update".
+ See gitlink:git-remote[1].
+
remote.<name>.url::
The URL of a remote repository. See gitlink:git-fetch[1] or
gitlink:git-push[1].
index a60c31a3150ca8109b1fb16aaf8ff485b57c9932..06ba2e6f26aca732c70d04b6d59190dd0e3a683e 100644 (file)
'git-remote' add <name> <url>
'git-remote' show <name>
'git-remote' prune <name>
+'git-remote' update
DESCRIPTION
-----------
Deletes all stale tracking branches under <name>.
These stale branches have already been removed from the remote repository
-referenced by <name>, but are still locally available in "remotes/<name>".
+referenced by <name>, but are still locally available in
+"remotes/<name>".
+
+'update'::
+
+Fetch updates for the remotes in the repository. By default all remotes
+are updated, but this can be configured via the configuration parameter
+'remote.fetch'. (See gitlink:git-config[1]).
DISCUSSION
diff --git a/git-remote.perl b/git-remote.perl
index c56c5a84a4ac67648efd3c5ccf690e9cb21dd54f..6e473ecfd06b56524acca7d69dc0e8eff5b9c820 100755 (executable)
--- a/git-remote.perl
+++ b/git-remote.perl
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;
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);
}