Cause
Git reads configuration settings from different paths and does not have access to some of them.
Git tries to read the root configuration setting instead of the configuration settings due to running the script using the su command with the reset option of environment variables (-m):
/bin/su -m $USER -c "cd $BASE/logs && $BASE/bin/startup.sh &> /dev/null"
The Bitbucket server is started as root using the /etc/init.d/atlbitbucket start script. Since the init.d script calls start-bitbucket.sh, which uses su -m, this means that the environment variables for root are saved and atlbitbucket does not have write permissions to the root home directory.
Git was compiled from the source using the default settings, which forbid other users than compiling Git to execute it
Resolution
Correct the rights to files and directories regarding the user of the Bitbucket server that runs the command:
chown <USER>.<GROUP> -R /home/<USER>/.config chown <USER>.<GROUP> -R /home/<USER>/.gitconfig
(info) Change USER.GROUP to your username and group in your OS.
If the Bitbucket server, starting with the script, has the su command, make sure the -m option is not used.
If the Bitbucket server is started by running /etc/init.d/atlbitbucket start start to start the Bitbucket server and start the atlbitbucket service
To have the Bitbucket server automatically start at boot, run chkconfig atlbitbucket on
Recompile Git using more reasonable defaults:
make prefix=/usr/local/git all make prefix=/usr/local/git install
or maybe these articles can help you https://confluence.atlassian.com/bitbucketserverkb/permission-denied-on-git-config-file-779171763.html