Skip to content

Instantly share code, notes, and snippets.

@WoodProgrammer
Created September 28, 2020 00:43
Show Gist options
  • Save WoodProgrammer/a59367829f9b026d10244febc6a2d3f6 to your computer and use it in GitHub Desktop.
Save WoodProgrammer/a59367829f9b026d10244febc6a2d3f6 to your computer and use it in GitHub Desktop.
#!/bin/sh
get_current_branch(){
export BRANCH=$(git branch --show-current)
}
check_remote_master(){
git log ${BRANCH} --pretty=format:'%h' > /tmp/local_branch
git fetch --all
git log origin/master --pretty=format:'%h' > /tmp/remote_master
while IFS= read line; do
if grep -q $line "/tmp/local_branch"; then
echo "Exist"
else
echo "Hey One missing commit from remote master ${line}"
fi
done < /tmp/remote_master
}
get_current_branch
check_remote_master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment