How to make git check for fetch and then make picture or sound? Want to have notification without fetching all the time all
Maybe you can create a new git
alias:
git config --global alias.f '!git fetch && [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ] && notify-send "Updates found"'
This creates a new alias f
which runs:
git fetch &&
[ $(git rev-parse HEAD) != $(git rev-parse @{u}) ] &&
notify-send "Updates found"
The middle line checks if the current branch and its remote are on the same page, and if not, uses notify-send
to send a notification.
Now if you run git f
in a branch with remote updates, you'll get a notification.