Wanted: A script that upon entering a directory asynchronously checks the git remotes for updates and reports if there is something to pull. — Pascal Hartig (@passy) May 1, 2013

So, here the code I came up with [First cut] :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 function cd () { async () { { $2 $( $1 ) } & } notify_callback () { [[ $1 > 0 ]] && echo "You have new stuff to pull!" } # If it's a git repo, check if we need to pull. if git rev-parse --is-inside-work-tree &>/dev/null; then async "git rev-list HEAD...origin/master --count" notify_callback fi builtin cd [email protected]" }

Place this in your .bashrc to override the cd command, to check if you cd to a git repo and then check and notify you if you need to pull stuff.

Happy Hacking! :-)

Update 0: