Skip to content

Instantly share code, notes, and snippets.

@csanz
Created May 6, 2019 17:42
Show Gist options
  • Save csanz/e41639b0c90ed3c29cd956fc01a37071 to your computer and use it in GitHub Desktop.
Save csanz/e41639b0c90ed3c29cd956fc01a37071 to your computer and use it in GitHub Desktop.
check if you need to pull new version from branch
#!/bin/sh
git fetch --quiet
CHANGES=(`git rev-list HEAD..origin/production --count`)
echo $CHANGES
# now you can check if the value is higher than 0, if yes, then you can git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment