Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. checkout_recent() {
  2. LASTN=${1:-5}
  3. git checkout $(git reflog | egrep -io 'moving from ([^[:space:]]+)' | awk '{ print $3 }' | awk ' !x[$0]++' | egrep -v '^[a-f0-9]{40}$' | head -n $LASTN | fzf)
  4. }
  5.  
  6. alias gre="checkout_recent"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement