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

前端 未结 4 1839
抹茶落季
抹茶落季 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 11:05

    I am posting a way to use _netrc to download materials from the site www.course.com.

    If someone is going to use the coursera-dl to download the open-class materials on www.coursera.com, and on the Windows OS someone wants to use a file like ".netrc" which is in like-Unix OS to add the option -n instead of -U -P for convenience. He/she can do it like this:

    1. Check the home path on Windows OS: setx HOME %USERPROFILE%(refer to VonC's answer). It will save the HOME environment variable as C:\Users\"username".

    2. Locate into the directory C:\Users\"username" and create a file name _netrc.NOTE: there is NOT any suffix. the content is like: machine coursera-dl login password

    3. Use a command like coursera-dl -n --path PATH to download the class materials. More coursera-dl options details for this page.

提交回复
热议问题