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 |
|
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:
Better approach would be to use (( $(git rev-list HEAD..@{u} --count) > 0 )) && echo "There are new things to merge"