分享

git push 403 error

 ansatsing 2018-05-22

错误提示如下

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

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

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

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

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

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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多