From c4ee2825ed9676fdf33165f1e1bfc3aff80b2b86 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Sun, 3 Oct 2010 23:25:53 +0200 Subject: [PATCH] tg-remote: use default remote if none is given MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is useful if the remote has new topics and you need to populate the local top-bases. Signed-off-by: Bert Wesarg Signed-off-by: Uwe Kleine-König --- README | 2 +- tg-remote.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README b/README index dec299f..15d20df 100644 --- a/README +++ b/README @@ -327,7 +327,7 @@ tg remote and 'git push' to operate on them. (Do NOT use 'git push --all' for your pushes - plain 'git push' will do the right thing.) - It takes a mandatory remote name argument, and optional + It takes a optional remote name argument, and optional '--populate' switch - use that for your origin-style remote, it will seed the local topic branch system based on the remote topic branches. '--populate' will also make 'tg remote' diff --git a/tg-remote.sh b/tg-remote.sh index 86dcd9a..61774d7 100644 --- a/tg-remote.sh +++ b/tg-remote.sh @@ -15,13 +15,16 @@ while [ -n "$1" ]; do --populate) populate=1;; -*) - echo "Usage: tg [...] remote [--populate] REMOTE" >&2 + echo "Usage: tg [...] remote [--populate] [REMOTE]" >&2 exit 1;; *) name="$arg";; esac done +[ -n "$name" ] || + name="$base_remote" + git config "remote.$name.url" >/dev/null || die "unknown remote '$name'" -- 2.11.4.GIT