Git http – securely remember credentials

git invokes cURL when running over HTTP. You can store secure credentials by setting up a .netrc file in your user’s home directory, and making it private to the user (0600 in Linux).

The contents of the file provide the username and password per remote domain.

machine myRemoteServer
login myUserName
password s3cret

See https://stackoverflow.com/questions/3947530/git-push-fatal-failed/7177690#7177690 for full server side configuration, which can easily include calls to your ldap server.

Leave a Comment