Skip to content

Commit f9c2d2b

Browse files
committed
Merge branch 'nd/maint-remote-remove' into maint
* nd/maint-remote-remove: remote: prefer subcommand name 'remove' to 'rm'
2 parents f2fef7b + e17dba8 commit f9c2d2b

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

Documentation/git-remote.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SYNOPSIS
1212
'git remote' [-v | --verbose]
1313
'git remote add' [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>
1414
'git remote rename' <old> <new>
15-
'git remote rm' <name>
15+
'git remote remove' <name>
1616
'git remote set-head' <name> (-a | -d | <branch>)
1717
'git remote set-branches' [--add] <name> <branch>...
1818
'git remote set-url' [--push] <name> <newurl> [<oldurl>]
@@ -85,6 +85,7 @@ In case <old> and <new> are the same, and <old> is a file under
8585
`$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to
8686
the configuration file format.
8787

88+
'remove'::
8889
'rm'::
8990

9091
Remove the remote named <name>. All remote-tracking branches and

builtin/remote.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = {
1111
"git remote [-v | --verbose]",
1212
"git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>",
1313
"git remote rename <old> <new>",
14-
"git remote rm <name>",
14+
"git remote remove <name>",
1515
"git remote set-head <name> (-a | -d | <branch>)",
1616
"git remote [-v | --verbose] show [-n] <name>",
1717
"git remote prune [-n | --dry-run] <name>",
@@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = {
3434
};
3535

3636
static const char * const builtin_remote_rm_usage[] = {
37-
"git remote rm <name>",
37+
"git remote remove <name>",
3838
NULL
3939
};
4040

@@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
15801580
result = add(argc, argv);
15811581
else if (!strcmp(argv[0], "rename"))
15821582
result = mv(argc, argv);
1583-
else if (!strcmp(argv[0], "rm"))
1583+
else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove"))
15841584
result = rm(argc, argv);
15851585
else if (!strcmp(argv[0], "set-head"))
15861586
result = set_head(argc, argv);

contrib/completion/git-completion.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,15 +2040,15 @@ _git_config ()
20402040

20412041
_git_remote ()
20422042
{
2043-
local subcommands="add rename rm set-head set-branches set-url show prune update"
2043+
local subcommands="add rename remove set-head set-branches set-url show prune update"
20442044
local subcommand="$(__git_find_on_cmdline "$subcommands")"
20452045
if [ -z "$subcommand" ]; then
20462046
__gitcomp "$subcommands"
20472047
return
20482048
fi
20492049

20502050
case "$subcommand" in
2051-
rename|rm|set-url|show|prune)
2051+
rename|remove|set-url|show|prune)
20522052
__gitcomp_nl "$(__git_remotes)"
20532053
;;
20542054
set-head|set-branches)

t/t5505-remote.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ EOF
125125
} &&
126126
git tag footag &&
127127
git config --add remote.oops.fetch "+refs/*:refs/*" &&
128-
git remote rm oops 2>actual1 &&
128+
git remote remove oops 2>actual1 &&
129129
git branch foobranch &&
130130
git config --add remote.oops.fetch "+refs/*:refs/*" &&
131131
git remote rm oops 2>actual2 &&
@@ -672,7 +672,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
672672
git clone one five &&
673673
origin_url=$(pwd)/one &&
674674
(cd five &&
675-
git remote rm origin &&
675+
git remote remove origin &&
676676
mkdir -p .git/remotes &&
677677
cat ../remotes_origin > .git/remotes/origin &&
678678
git remote rename origin origin &&

t/t5540-http-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ test_expect_success 'http-push fetches packed objects' '
109109
# By reset, we force git to retrieve the packed object
110110
(cd "$ROOT_PATH"/test_repo_clone_packed &&
111111
git reset --hard HEAD^ &&
112-
git remote rm origin &&
112+
git remote remove origin &&
113113
git reflog expire --expire=0 --all &&
114114
git prune &&
115115
git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)

0 commit comments

Comments
 (0)