Created
September 28, 2020 00:43
-
-
Save WoodProgrammer/a59367829f9b026d10244febc6a2d3f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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