fatal: unable to access : The requested URL returned error: 403

浅浅的花香味﹌ 2022-09-28 13:09 46阅读 0赞

错误提示如下

  1. C:\Users\AllenIverson\Desktop\gitbook-test>git push -u gitbook master
  2. remote: Forbidden
  3. fatal: unable to access 'https://git.gitbook.com/alleniverson/mybook.git/': The requested URL returned error: 403

在使用Git向GitBook仓库push(推送)更新的时候遇到的问题,Google了一下,在.git文件夹下的config文件中远程仓库url添加username@,如下

  1. [core]
  2. repositoryformatversion = 0
  3. filemode = false
  4. bare = false
  5. logallrefupdates = true
  6. symlinks = false
  7. ignorecase = true
  8. [remote "gitbook"]
  9. url = https://alleniverson@git.gitbook.com/alleniverson/mybook.git
  10. fetch = +refs/heads/*:refs/remotes/gitbook/*

再次push,依然是403,再次修改,添加username:password@,如下

  1. [core]
  2. repositoryformatversion = 0
  3. filemode = false
  4. bare = false
  5. logallrefupdates = true
  6. symlinks = false
  7. ignorecase = true
  8. [remote "gitbook"]
  9. url = https://alleniverson:mypassword@git.gitbook.com/alleniverson/mybook.git
  10. fetch = +refs/heads/*:refs/remotes/gitbook/*

再次push,成功。原因是:私有项目,没有权限,需要输入用户名密码

发表评论

表情:
评论列表 (有 0 条评论,46人围观)

还没有评论,来说两句吧...

相关阅读