diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt index a308f4c79f1a879e124486ef6cffbb2e9f8e606c..e8c396b5f92903777ce5905cf52e2ef879850739 100644 --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git remote' [-v | --verbose] 'git remote add' [-t ] [-m ] [-f] [--tags|--no-tags] [--mirror=] 'git remote rename' -'git remote rm' +'git remote remove' 'git remote set-head' (-a | -d | ) 'git remote set-branches' [--add] ... 'git remote set-url' [--push] [] @@ -85,6 +85,7 @@ In case and are the same, and is a file under `$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to the configuration file format. +'remove':: 'rm':: Remove the remote named . All remote-tracking branches and diff --git a/builtin/remote.c b/builtin/remote.c index 920262d76ec9bdc40a8ad7703cf1eb972a40eb9e..357d59d66792308c4c4d767523767c6d078d7341 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = { "git remote [-v | --verbose]", "git remote add [-t ] [-m ] [-f] [--tags|--no-tags] [--mirror=] ", "git remote rename ", - "git remote rm ", + "git remote remove ", "git remote set-head (-a | -d | )", "git remote [-v | --verbose] show [-n] ", "git remote prune [-n | --dry-run] ", @@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = { }; static const char * const builtin_remote_rm_usage[] = { - "git remote rm ", + "git remote remove ", NULL }; @@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix) result = add(argc, argv); else if (!strcmp(argv[0], "rename")) result = mv(argc, argv); - else if (!strcmp(argv[0], "rm")) + else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove")) result = rm(argc, argv); else if (!strcmp(argv[0], "set-head")) result = set_head(argc, argv); diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5a5b5a0b3c21f129133614db78ad33299987b11c..3b982903491e01b8ca03c1e8f8943f5abc4dc553 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2040,7 +2040,7 @@ _git_config () _git_remote () { - local subcommands="add rename rm set-head set-branches set-url show prune update" + local subcommands="add rename remove set-head set-branches set-url show prune update" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" @@ -2048,7 +2048,7 @@ _git_remote () fi case "$subcommand" in - rename|rm|set-url|show|prune) + rename|remove|set-url|show|prune) __gitcomp_nl "$(__git_remotes)" ;; set-head|set-branches) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index e8af615e6dcdf365416ef9f71825c17a0d601186..c03ffdde1036f37d35db0d8147af20ffdd79bbb1 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -125,7 +125,7 @@ EOF } && git tag footag && git config --add remote.oops.fetch "+refs/*:refs/*" && - git remote rm oops 2>actual1 && + git remote remove oops 2>actual1 && git branch foobranch && git config --add remote.oops.fetch "+refs/*:refs/*" && git remote rm oops 2>actual2 && @@ -672,7 +672,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' ' git clone one five && origin_url=$(pwd)/one && (cd five && - git remote rm origin && + git remote remove origin && mkdir -p .git/remotes && cat ../remotes_origin > .git/remotes/origin && git remote rename origin origin && diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh index f141f2d1da3ca8186ccc7a742bddd06f2e7f8970..01d0d95b4d6476f691f650cc413fa7156caee88b 100755 --- a/t/t5540-http-push.sh +++ b/t/t5540-http-push.sh @@ -109,7 +109,7 @@ test_expect_success 'http-push fetches packed objects' ' # By reset, we force git to retrieve the packed object (cd "$ROOT_PATH"/test_repo_clone_packed && git reset --hard HEAD^ && - git remote rm origin && + git remote remove origin && git reflog expire --expire=0 --all && git prune && git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)