Skip to content

Commit 9058560

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

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
N_("git remote [-v | --verbose]"),
1212
N_("git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>"),
1313
N_("git remote rename <old> <new>"),
14-
N_("git remote rm <name>"),
14+
N_("git remote remove <name>"),
1515
N_("git remote set-head <name> (-a | -d | <branch>)"),
1616
N_("git remote [-v | --verbose] show [-n] <name>"),
1717
N_("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-
N_("git remote rm <name>"),
37+
N_("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
@@ -2032,15 +2032,15 @@ _git_config ()
20322032

20332033
_git_remote ()
20342034
{
2035-
local subcommands="add rename rm set-head set-branches set-url show prune update"
2035+
local subcommands="add rename remove set-head set-branches set-url show prune update"
20362036
local subcommand="$(__git_find_on_cmdline "$subcommands")"
20372037
if [ -z "$subcommand" ]; then
20382038
__gitcomp "$subcommands"
20392039
return
20402040
fi
20412041

20422042
case "$subcommand" in
2043-
rename|rm|set-url|show|prune)
2043+
rename|remove|set-url|show|prune)
20442044
__gitcomp_nl "$(__git_remotes)"
20452045
;;
20462046
set-head|set-branches)

t/t5505-remote.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ EOF
131131
} &&
132132
git tag footag &&
133133
git config --add remote.oops.fetch "+refs/*:refs/*" &&
134-
git remote rm oops 2>actual1 &&
134+
git remote remove oops 2>actual1 &&
135135
git branch foobranch &&
136136
git config --add remote.oops.fetch "+refs/*:refs/*" &&
137137
git remote rm oops 2>actual2 &&
@@ -678,7 +678,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
678678
git clone one five &&
679679
origin_url=$(pwd)/one &&
680680
(cd five &&
681-
git remote rm origin &&
681+
git remote remove origin &&
682682
mkdir -p .git/remotes &&
683683
cat ../remotes_origin > .git/remotes/origin &&
684684
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)