Skip to content

Instantly share code, notes, and snippets.

View kevinkepp's full-sized avatar

Kevin Kepp kevinkepp

  • Berlin, Germany
View GitHub Profile
@kevinkepp
kevinkepp / count-commits-per-branch.sh
Created February 5, 2014 15:39
Show the number of commits of each branch in the Git repository
#!/bin/sh
for branch in `git branch | grep -v '\->'`;
do
git checkout $branch
no=$(git log --pretty=oneline | wc -l)
echo -e "$branch:\t$no"
done
@kevinkepp
kevinkepp / list-files-by-size.sh
Last active January 3, 2016 13:38
Linux: Recursively list all files in a directory by size
find . -type f -exec ls -lh {} \; | awk '{print $5, $9}' | sort -h -r
@kevinkepp
kevinkepp / branches-by-last-commit.sh
Created January 17, 2014 08:39
Git: List all branches by the date of their last commit
git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate) %(refname)' | sed 's/refs\/heads\///g'
@kevinkepp
kevinkepp / checkout-branches.sh
Created January 17, 2014 08:38
Git: Checkout and track all remote branches ("deep clone")
for remote in `git branch -r | grep -v '\->'`; do git checkout --track $remote; done