Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Staubgeborener committed Jan 29, 2024
2 parents 519aa33 + c82d3be commit cb50055
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ fi
cd "$backup_path"
git add .
git commit -m "$commit_message"
# Check if HEAD still matches remote (Means there are no updates to push) and create a empty commit just informing that there are no new updates to push
if [[ $(git rev-parse HEAD) == $(git ls-remote $(git rev-parse --abbrev-ref @{u} 2>/dev/null | sed 's/\// /g') | cut -f1) ]]; then
git commit --allow-empty -m "$commit_message - No new changes pushed"
fi
git push -u origin "$branch_name"

# Remove files except .git folder after backup so that any file deletions can be logged on next backup
Expand Down

0 comments on commit cb50055

Please sign in to comment.