Skip to content

Instantly share code, notes, and snippets.

@andrewmriley
andrewmriley / git-branches-by-commit-date.sh
Last active April 21, 2016 13:19 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches on origin and the last commit date/email for each branch. Sort by most recent commit date.
#!/bin/sh
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep origin | grep -v HEAD`;do echo -e `git show --format="%ci %cr %aE" $branch | head -n 1` \\t$branch; done | sort -r
@andrewmriley
andrewmriley / clean_remote
Created April 14, 2016 19:15
Command line to clean up remote git branches using peco for single selection/filtering
# change out REMOTENAME with your actual remotes reference
git branch -r | grep REMOTENAME | peco | cut -d/ -f2- | xargs -n 1 git push --delete REMOTENAME
@andrewmriley
andrewmriley / gist:6401eef48859519f483c
Last active April 23, 2024 18:19
Copy your current git branch name to clipboard
## Choose one and add it as an alias or throw it in a script ##
### Modern Git Thanks to @Pezmc
# Linux/Unix Wayland
git branch --show-current | wl-copy
# Linux/Unix X11
git branch --show-current | xclip -selection clipboard
# MacOS

Keybase proof

I hereby claim:

  • I am andrewmriley on github.
  • I am andrewmriley (https://keybase.io/andrewmriley) on keybase.
  • I have a public key whose fingerprint is C490 CF36 3C24 3965 C9EF D71A 1061 75C9 D59C 19DA

To claim this, I am signing this object: