Skip to content

Instantly share code, notes, and snippets.

@KyWa
Created June 28, 2021 22:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
basic git check
#!/bin/bash
repodir="/home/user/repo"
check_git() {
cd $repodir
current="cat .git/FETCH_HEAD | awk '{print $1}'"
git pull
pulled="cat .git/FETCH_HEAD | awk '{print $1}'"
if [ $current = $pulled ];then
do_thing
else
exit
fi
}
do_thing() {
podman build
do yo thang
}
check_git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment