From 80c49d15109fc60860ec063b17bcd2da35cc2860 Mon Sep 17 00:00:00 2001 From: LukeGus Date: Thu, 28 Nov 2024 01:34:32 +0000 Subject: [PATCH] Commit --- git_push.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git_push.sh b/git_push.sh index 891812bf..00184f6b 100755 --- a/git_push.sh +++ b/git_push.sh @@ -10,6 +10,9 @@ fi COMMIT_MESSAGE=$1 BRANCH_NAME=$2 +# Ensure Git is using the credential helper for HTTPS +git config --global credential.helper store + # Check if the branch exists BRANCH_EXISTS=$(git branch --list "$BRANCH_NAME") @@ -51,6 +54,8 @@ if [ $? -ne 0 ]; then fi echo "Pushing changes forcefully to branch: $BRANCH_NAME" +# Set GIT_ASKPASS to bypass the password prompt using the stored credentials +export GIT_ASKPASS=echo git push -f origin "$BRANCH_NAME" if [ $? -ne 0 ]; then echo "Push failed."