Files
fn_registry/bash/functions/shell/git_clean_branches.md
T
egutierrez 61d8460149 feat: add bash shell utility functions
12 funciones Bash del dominio shell: utilidades de scripting (bash_log,
bash_colors, bash_check_deps, bash_confirm, bash_handle_error, bash_safe_run),
manipulacion de texto (convert_text_case), estructura de proyectos
(create_project_structure), y operaciones git (git_clean_branches,
git_log_visual, git_push_all_remotes, git_repo_status). Cada una con su
.sh y .md de frontmatter.
2026-04-12 13:54:15 +02:00

1.6 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path, source_repo, source_license, source_file
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path source_repo source_license source_file
git_clean_branches function bash shell 1.0.0 impure git_clean_branches([base_branch: string], [--remote], [--force]) -> void Elimina ramas locales ya mergeadas en la rama base (autodetecta main/master). Con --remote también borra las ramas en todos los remotes. Con --force omite la confirmación interactiva.
bash
git
branches
clean
merge
false error_go_core
name desc
base_branch rama base para detectar merges (opcional; autodetecta main o master)
name desc
--remote flag para también eliminar ramas en todos los remotes
name desc
--force flag para omitir confirmación interactiva
lista de ramas eliminadas a stdout; exit code 1 si no es repo Git o no se detecta la rama base false
bash/functions/shell/git_clean_branches.sh https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git MIT scripts/linux/git_utils/limpiar_ramas.sh

Ejemplo

source bash/functions/shell/git_clean_branches.sh

# Limpieza básica con confirmación
git_clean_branches

# Sin confirmación, sobre rama base "develop"
git_clean_branches develop --force

# Eliminar también en remotes
git_clean_branches main --remote --force

Notas

Ramas protegidas que nunca se eliminan: main, master, develop, dev, staging, release. Siempre hace prune de referencias remotas obsoletas antes de buscar candidatos.