Introduce git-remote rm <name> which will:
- Remove the remote config entry for <name>.
- Remove any config entries for tracking branches of <name>.
- Remove any stored remote branches of <name>.
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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>
Many other commands already have such an option, and I find it
practical to see where all the remotes actually come from.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
'git-remote show remote-name' lists the refs that are pushed to the remote
by showing the 'Push' line from the config file. But before showing it,
it shortened 'refs/heads/here:refs/heads/there' to 'here:there'. However,
if the Push line is prefixed with a plus, the ref was not shortened.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This patch renames config_boolean() to config_bool() for consistency with
the commandline interface and because it is shorter but still obvious. ;-)
It also changes the return value from some obscure string to real Perl
boolean, allowing for clean user code.
Signed-off-by: Petr Baudis <pasky@suse.cz>
The configured refspecs are printed almost verbatim, i.e. both the local
and the remote branch name separated by a colon are printed; only the
prefix 'refs/heads/' is removed, like this:
Local branch(es) pushed with 'git push'
master refs/tags/*:refs/tags/* next:next
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
[jc: the original from Pavel was limiting the variable names to only
fetch and url, but I loosened it to take valid variable names.]
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
In response to a feature request from Shawn Pearce, this patch allows
a user to update a named group of remotes by using "git remote update
<group>", where the group is defined in the config file by
remotes.<group>. The default if the named group is not specified is
now fetched group remotes.default, instead of remote.fetch, which is
what had been previously used.
In addition, if remotes.default is not defined, all remotes defined in
the config file will be used, as before, but there is now also
possible to request that a particular repository to be skipped by
default by using the boolean configuration parameter
remote.<name>.skipDefaultUpdate.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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>
This adds three options to 'git-remote add'.
* -f (or --fetch) option tells it to also run the initial "git
fetch" using the newly created remote shorthand.
* -t (or --track) option tells it not to use the default
wildcard to track all branches.
* -m (or --master) option tells it to make the
remote/$name/HEAD point at a remote tracking branch other
than master.
For example, with this I can say:
$ git remote add -f -t master -t quick-start -m master \
jbf-um git://linux-nfs.org/~bfields/git.git/
to
(1) create remote.jbf-um.url;
(2) track master and quick-start branches (and no other); the
two -t options create these two lines:
fetch = +refs/heads/master:refs/remotes/jbf-um/master
fetch = +refs/heads/quick-start:refs/remotes/jbf-um/quick-start
(3) set up remotes/jbf-um/HEAD to point at jbf-um/master so
that later I can say "git log jbf-um"
Or I could do
$ git remote add -t 'ap/*' andy /home/andy/git.git
to make Andy's topic branches kept track of under refs/remotes/andy/ap/.
Other possible improvements I considered but haven't implemented
(hint, hint) are:
* reject wildcard letters other than a trailing '*' to the -t
parameter;
* make -m optional and when the first -t parameter does not
have the trailing '*' default to that value (so the above
example does not need to say "-m master");
* if -m is not given, and -t parameter ends with '*' (i.e. the
above defaulting did not tell us where to point HEAD at), and
if we did the fetch with -f, check if 'master' was fetched
and make HEAD point at it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Since it can be annoying to manually cleanup 40 tracking branches
which were removed by the remote system, 'git remote prune <n>'
can now be used to delete any tracking branches under <n> which
are no longer available on the remote system.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
I want to reuse the stale branch detection to implement a new
'git remote prune' subcommand. Easiest way to do that is to use
the same logic that 'git remote show' uses to determine the stale
tracking branches, then delete those.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
It might be handy to have a single command that helps you manage
your configuration that relates to downloading from remote
repositories. This currently does only about 20% of what I want
it to do.
$ git remote
shows the list of 'remotes' you have defined somewhere, and
$ git remote origin
shows the details about the named remote (in this case
"origin"). How the branches are tracked, if you have a
tracking branch that is stale, etc.
$ git add another git://git.kernel.org/pub/...
defines the default remote.another.url and remote.another.fetch
entries just like a clone does; you can say "git fetch another"
afterwards.
For it to be useful, I think it should be enhanced to:
- check overlaps of tracking branches and warn;
- offer to remove stale tracking branches in one go;
- offer ways to remove or rename remote;
- offer ways to update an existing remote, perhaps have an
interactive mode;
Other enhancements might be also possible, but I do not think of
anything that is absolutely necessary other than the above right
now.
Signed-off-by: Junio C Hamano <junkio@cox.net>