Git http - securely remember credentials

前端 未结 5 2134
既然无缘
既然无缘 2020-11-28 03:45

Is there a way to securely let git remember my credentials when connecting to remote repositories over HTTP(S)?

I\'ve tried the core.askpass approach d

5条回答
  •  温柔的废话
    2020-11-28 04:00

    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.

提交回复
热议问题