summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1e61b76)
raw | patch | inline | side by side (parent: 1e61b76)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sun, 2 Sep 2007 20:10:14 +0000 (21:10 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Sep 2007 10:08:12 +0000 (03:08 -0700) |
When using the "--mirror" option to "git remote add", the refs will not
be stored in the refs/remotes/ namespace, but in the same location as
on the remote side.
This option probably only makes sense in a bare repository.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
be stored in the refs/remotes/ namespace, but in the same location as
on the remote side.
This option probably only makes sense in a bare repository.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-remote.txt | patch | blob | history | |
git-remote.perl | patch | blob | history |
index 61a6022ce8a0fc7aac8b1e9bd08587817ef0d69c..94b9f177724993b800e5d0bd4e67f986bfffc188 100644 (file)
--------
[verse]
'git-remote'
-'git-remote' add [-t <branch>] [-m <branch>] [-f] <name> <url>
+'git-remote' add [-t <branch>] [-m <branch>] [-f] [--mirror] <name> <url>
'git-remote' show <name>
'git-remote' prune <name>
'git-remote' update [group]
With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
up to point at remote's `<master>` branch instead of whatever
branch the `HEAD` at the remote repository actually points at.
++
+In mirror mode, enabled with `--mirror`, the refs will not be stored
+in the 'refs/remotes/' namespace, but in 'refs/heads/'. This option
+only makes sense in bare repositories.
'show'::
diff --git a/git-remote.perl b/git-remote.perl
index 01cf480221be1e5860bd701d5d17ced25766d38d..f6f283ea4f8b45671b7d9b34687d5d7b8475e8b3 100755 (executable)
--- a/git-remote.perl
+++ b/git-remote.perl
for (@$track) {
$git->command('config', '--add', "remote.$name.fetch",
- "+refs/heads/$_:refs/remotes/$name/$_");
+ $opts->{'mirror'} ?
+ "+refs/$_:refs/$_" :
+ "+refs/heads/$_:refs/remotes/$name/$_");
}
if ($opts->{'fetch'}) {
$git->command('fetch', $name);
shift @ARGV;
next;
}
+ if ($opt eq '--mirror') {
+ $opts{'mirror'} = 1;
+ next;
+ }
add_usage();
}
if (@ARGV != 3) {