My preferred way to solve git authentication issues is to connect using ssh instead of http and add my public key the server as an authorized key in the .ssh directory. But I understand that this is not always possible.
If you want to go low level, this might help: https://community.wolfram.com/groups/-/m/t/181627