how can i set credentionals?

Hi everyone!

inside project we have custom packages via our private git store

how can i set credentionals for pacage manager?

trying

git config --global user.name "name"
git config --global user.username "name"
git config --global user.email "mail"
git config --global user.password "pass"

via pre-build script

fatal: could not read Username for ‘[reponame]’: terminal prompts disabled
You may need to set up a Git credentials helper to access a private repository.

could not read Password for 'https://name@git.address.com': terminal prompts disabled

finally i found a solution
added credential with pre-build script

git config --global credential.https://git.address.com.helper store
echo "https://name:password@git.address.com" > ~/.git-credentials

How and where to create that git-credentials file?