mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 09:42:27 +00:00
Push if local and remote don't match
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user