You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: script.sh
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,10 @@ fi
114
114
cd"$backup_path"
115
115
git add .
116
116
git commit -m "$commit_message"
117
+
# 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
118
+
if [[ $(git rev-parse HEAD)==$(git ls-remote $(git rev-parse --abbrev-ref @{u} 2>/dev/null | sed 's/\// /g')| cut -f1) ]];then
119
+
git commit --allow-empty -m "$commit_message - No new changes pushed"
120
+
fi
117
121
git push -u origin "$branch_name"
118
122
119
123
# Remove files except .git folder after backup so that any file deletions can be logged on next backup
0 commit comments