3

配置选项git config --global http.cookiefile /<absolute path>/my_cookiefile似乎对 git 没有任何影响。具有以下 cookiefile :

设置 Cookie:my_cookie=my_value; 路径=/; 域名=.github.com

该文件可以直接使用:

$curl -v --cookie my_cookiefile https://github.com/my_url

GET my_url HTTP/1.1
主机:github.com
Cookie:my_cookie=my_value

但它对 git 没有影响(相同的 curl 输出但没有 cookie 标头):

$export GIT_CURL_VERBOSE=1 && git clone https://github.com/my_url

GET my_url HTTP/1.1
主机:github.com

git 版本 1.7.1

知道什么可能是错的吗?

4

1 回答 1

0

您可以尝试手动添加。首先导航到您的目录.git和文件。如果它不包括设置为某事(无论是在 a 之后),您可以尝试像这样手动设置它:在您选择的编辑器中打开文件,并将以下内容粘贴到该文件的底部,替换为绝对cookie 文件的路径(如果该部分已定义,则省略;如果已定义,则在现有部分下添加设置):catconfigcookiefile==config<absolute_path_to_file>[http]

[http]
    cookiefile = <absolute_path_to_file>

保存,退出并重试。

于 2013-09-06T14:49:06.410 回答