Going back to coding a bit, so sharing the Git aliases I use daily.
[alias] st = status -sb # Short status with branch info co = checkout # Switch branches or restore files br = branch # List, create or delete branches ci = commit # Open editor to write commit message cm = commit -m # Commit with inline message: git cm "msg" df = diff # Show unstaged changes dfs = diff --staged # Show staged changes (before commit) p = push # Push to remote pr = pull --rebase # Pull and rebase instead of merge save = stash save # Stash current changes with a name savem = stash save --keep-index # Stash unstaged only, keep staged intact recover = stash pop --index # Restore last stash and preserve staging recoverf = !git stash show -p | git apply && git stash drop # Apply stash as patch only, no index restore undo = reset HEAD~1 --mixed # Uncommit last commit, keep changes unstaged nuke = reset --hard # Discard ALL local changes permanently (careful!) showf = show --pretty="format:" --name-only # List files changed in a commit h = log --graph --date=short --pretty=format:'%Cgreen%h%Creset %Cblue%ad%Creset | %s%Cgreen%d%Creset %C(yellow)[%an]%Creset' # Colored graph log for current branch ha = log --graph --date=short --all --pretty=format:'%Cgreen%h%Creset %Cblue%ad%Creset | %s%Cgreen%d%Creset %C(yellow)[%an]%Creset' # Colored graph log for ALL branches
These aliases are based on the ones I originally published on Gist back in 2018.
Listen to this as a podcast in Spanish:
Deja un comentario