Skip to content

Instantly share code, notes, and snippets.

@radimih
Created March 10, 2022 06:32
Show Gist options
  • Save radimih/977c9075aeebc7ea0c23e3284f7b1db3 to your computer and use it in GitHub Desktop.
Save radimih/977c9075aeebc7ea0c23e3284f7b1db3 to your computer and use it in GitHub Desktop.
Check git repository updates
cd path-to-git-repository
if [ `git log --pretty=%H ...refs/heads/master^` == `git ls-remote origin -h refs/heads/master | cut -f1` ]; then
exit 1;
fi
git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment