Por Anónimo (no verificado) , 29 Abril 2026

Alias que pagan renta

Los primeros diez alias de Git que todos usan cubren lo básico. La siguiente capa es donde la productividad realmente se compone.

Logging

[alias]
    l = log --oneline --decorate -20
    ll = log --oneline --decorate --graph --all
    lg = log --graph --pretty=format:'%C(yellow)%h%Creset %C(cyan)%an%Creset %s %C(green)(%cr)%Creset %C(red)%d%Creset'
    recent = "log --pretty=format:'%C(yellow)%h%Creset %s %C(green)(%cr)%Creset' --date=relative -10"

Status y diffing

[alias]
    s = status -sb
    d = diff
    dc = diff --cached
    dw = diff --word-diff
    ds = diff --stat
    df = "!git diff --color $@ | diff-so-fancy"

Gestión de branches

[alias]
    br = branch
    brd = branch -d
    new = checkout -b
    sw = switch
    swc = switch -c
    recent-branches = "for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(refname:short)'"
    gone = "!git fetch --prune && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D"

Workflows de sync

[alias]
    sync = "!git fetch --all --prune && git pull --rebase"
    update = "!git checkout main && git pull && git checkout - && git rebase main"
    publish = "!git push -u origin $(git symbolic-ref --short HEAD)"
    unpublish = "!git push origin --delete $(git symbolic-ref --short HEAD)"

Atajos de commit

[alias]
    amend = commit --amend --no-edit
    reword = commit --amend
    wip = "!git add -A && git commit -m 'WIP'"
    unwip = reset --soft HEAD~1
    save = "!f() { git add -A && git commit -m \"savepoint: ${1:-$(date)}\"; }; f"

Helpers de stash

[alias]
    ss = stash save
    sp = stash pop
    sl = stash list
    sa = stash apply

Helpers de rebase

[alias]
    rb = rebase
    rbi = rebase -i
    rbc = rebase --continue
    rba = rebase --abort
    rbs = rebase --skip
    fixup = "!f() { git commit --fixup $1; }; f"
    autosquash = "rebase -i --autosquash"

Exploración de historia

[alias]
    who = "shortlog -sn --no-merges"
    last = log -1 HEAD --stat
    find = "!f() { git log --all --pretty=format:'%h %s' --grep=\"$1\"; }; f"
    contains = "branch --contains"
    first = "log --reverse --pretty=format:'%h %s' -1"

Limpieza

[alias]
    cleanup = "!git fetch --prune && git branch --merged main | grep -v -E '^\\*|^\\s*(main|master|develop)$' | xargs -r git branch -d"
    nuke = "!git reset --hard HEAD && git clean -fd"
    prune-all = "!git fetch --all --prune && git gc --aggressive"

Cargar alias

git config --global include.path ~/.gitconfig.aliases