1

How to make git check for fetch and then make picture or sound? Want to have notification without fetching all the time all

1
  • "without fetching all the time all" ... all what? – muru Mar 9 '16 at 16:39
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.