Push if local and remote don't match

This commit is contained in:
2021-03-19 08:31:55 +00:00
parent 31c3e53e30
commit 71b4d44d20

View File

@@ -64,10 +64,14 @@ function commit-pkm() {
cd ~/Documents/pkm
if [[ `git status --porcelain` ]]; then
echo "Changes detected, commiting..."
git add -A && git commit -a -m 'Manual savepoint' && git push origin
git add -A && git commit -a -m 'Manual savepoint'
else
echo "No changes detected"
fi
git fetch
if [ $(git rev-parse main) != $(git rev-parse refs/remotes/origin/main) ]; then
git push origin
fi
cd $PREVDIR
fi
}