DEV Community

Discussion on: Your favorite `git` aliases?

Collapse
 
wuz profile image
Conlin Durbin • Edited

I really like these:

get = !git pull --ff-only - lets me run git get to only pull fast forward changes

who = shortlog -n -s --no-merges - this is more of a fun one. Shows a list of who has committed to the project and how many commits they have made

A complicated one

fco="!f() { git branch -a -vv --color=always --format='%(refname)' | sed "s_refs/heads/__" | sed "s_refs/remotes/__" | fzf --query="$@" --height=40% --ansi --tac --color=16 --border | awk '{print $1}' | xargs git co; }; f"

This requires fzf to be installed but allows you to fuzzy find and check out a git branch. Really useful when you don't remember the branch name exactly but have an idea of what it might be.