# [PATCH] Allow 'git-remote fetch' as a synonym for 'git fetch'

2 messages from 2007-03-18 to 2007-03-18. Participants: Sam Vilain.
Thread: https://gitlist.dev/t/7292

## Sam Vilain, 2007-03-18 09:47

Subject: [PATCH] Allow 'git-remote fetch' as a synonym for 'git fetch'
Message-ID: <20070318094910.7985613A382@magnus.utsl.gen.nz>
URL: https://gitlist.dev/e/20070318094910.7985613A382%40magnus.utsl.gen.nz

```
I found myself typing this when doing remote-like things.  Perhaps
other people will find this useful.

Signed-off-by: Sam Vilain <sam@vilain.net>
---
 git-remote.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index c56c5a8..305f2e3 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -355,10 +355,14 @@ elsif ($ARGV[0] eq 'add') {
 	}
 	add_remote($ARGV[1], $ARGV[2], \%opts);
 }
+elsif ($ARGV[0] eq 'fetch') {
+	exec("git-fetch", @ARGV[1..$#ARGV]);
+}
 else {
 	print STDERR "Usage: git remote\n";
 	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 fetch <fetch-options> <repository> <refspec>...\n";
 	exit(1);
 }
-- 
1.5.0.2.gdcde2

```

## Sam Vilain, 2007-03-18 10:03

Subject: Re: [PATCH] git-remote: allow 'git-remote fetch' as a synonym for 'git fetch'
Message-ID: <20070318101311.E296213A382@magnus.utsl.gen.nz>
URL: https://gitlist.dev/e/20070318101311.E296213A382%40magnus.utsl.gen.nz
In-Reply-To: <20070318094910.7985613A382@magnus.utsl.gen.nz>

```
And here it is again, this time with documentation and based against
maint.

From: Sam Vilain <sam@vilain.net>
Subject: git-remote: allow 'git-remote fetch' as a synonym for 'git fetch'

I found myself typing this when doing remote-like things.  Perhaps
other people will find this useful

Signed-off-by: Sam Vilain <sam@vilain.net>
---
 Documentation/git-remote.txt |    4 ++++
 git-remote.perl              |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index de2658c..ab04b86 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -64,6 +64,10 @@ With `-n` option, the remote heads are not confirmed first with `git
 ls-remote <name>`; cached information is used instead.  Use with
 caution.
 
+'fetch'::
+
+Synonym for `git fetch <name>`, and accepts all the same options.
+
 'update'::
 
 Fetch updates for a named set of remotes in the repository as defined by
diff --git a/git-remote.perl b/git-remote.perl
index bd70bf1..20f9f54 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -389,11 +389,15 @@ elsif ($ARGV[0] eq 'add') {
 	}
 	add_remote($ARGV[1], $ARGV[2], \%opts);
 }
+elsif ($ARGV[0] eq 'fetch') {
+	exec("git-fetch", @ARGV[1..$#ARGV]);
+}
 else {
 	print STDERR "Usage: git remote\n";
 	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 [group]\n";
+	print STDERR "       git remote fetch <fetch-options> <repository> <refspec>...\n";
 	exit(1);
 }
-- 
1.5.0.2.gdcde2

```
