[ad_1]
Is there anyway to provide credentials to a git push without going through the git prompt for a username and password/token?
I am converting an automated Git push script from Java to Bash and my problem is that the first ‘push’ command will prompt for the username and password/token. I have executed the following commands to set the credentials:
git config --global user.name "your username"
git config --global user.password "your password"
git config credential.helper store
Here is the first pass at the bash script I am trying to execute:
#!/bin/bash
IFS='
'
for tbl in $(git remote show origin); do
if [[ "$tbl" == *"pushes to"* ]]; then
branchName=$(echo "$tbl" | awk '{print $1}')
echo "Pushing branch: $branchName"
echo $(git push origin $branchName)
fi
done
My version of git is 2.36 and this will be executed from within a docker container.
Do I need to create a custom git credential helper?
Thanks in advance for any help.
[ad_2]