Git - How to use .netrc file on Windows to save user and password

前端 未结 4 1826
抹茶落季
抹茶落季 2020-11-22 10:36

Is it possible to use a .netrc file on Windows when I\'m using Git to clone a remote repository with HTTP and user - password?

4条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 10:52

    This will let Git authenticate on HTTPS using .netrc:

    • The file should be named _netrc and located in c:\Users\.
    • You will need to set an environment variable called HOME=%USERPROFILE% (set system-wide environment variables using the System option in the control panel. Depending on the version of Windows, you may need to select "Advanced Options".).
    • The password stored in the _netrc file cannot contain spaces (quoting the password will not work).

提交回复
热议问题