Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用个人访问令牌推送到git是在询问密码_Linux_Git_Github_Oauth_Sh - Fatal编程技术网

Linux 使用个人访问令牌推送到git是在询问密码

Linux 使用个人访问令牌推送到git是在询问密码,linux,git,github,oauth,sh,Linux,Git,Github,Oauth,Sh,我有一个shell脚本文件,它将文件推送到空的git repo git init git add . git commit -m "first commit" git remote add origin https://<my-personal-access-token>@github.com/<organization-name>/<repo-name>.git git push -u origin master git init git添加。 git提

我有一个shell脚本文件,它将文件推送到空的git repo

git init
git add .
git commit -m "first commit"
git remote add origin https://<my-personal-access-token>@github.com/<organization-name>/<repo-name>.git 
git push -u origin master
git init
git添加。
git提交-m“首次提交”
git远程添加源https://@github.com/.git
git-push-u源主机
这是在不要求密码的情况下将文件推送到repo,但令人惊讶的是,现在它也要求密码

为什么即使我使用了个人访问令牌,它也会询问密码?这里出了什么问题

即使我手动输入正确的密码,也会显示如下:


您可以在git remote步骤代码的下面一行添加用户名来尝试:

git remote add origin https://username:<my-personal-access-token>@github.com/<organization-name>/<repo-name>.git
git远程添加源https://username:@github.com/.git

您可以在git remote步骤代码的下面一行中添加用户名

git remote add origin https://username:<my-personal-access-token>@github.com/<organization-name>/<repo-name>.git
git远程添加源https://username:@github.com/.git

仍然存在相同的错误:无效的用户名或密码仍然存在相同的错误:无效的用户名或密码