zoukankan      html  css  js  c++  java
  • github push 403 Forbidden

    github push 403 Forbidden
    root@jun-live:github#git push -u origin master
    error: The requested URL returned error: 403 Forbidden while accessing https://github.com/liujun1990/shelltweak.git/info/refs

    fatal: HTTP request failed
    root@jun-live:.git#cat config
    [core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
    [remote "origin"]
        url = https://liujun1990@github.com/liujun1990/shelltweak.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master

    root@jun-live:github#git push -u origin master
    Counting objects: 47, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (46/46), done.
    Writing objects: 100% (46/46), 22.08 KiB, done.
    Total 46 (delta 7), reused 0 (delta 0)
    To https://liujun1990@github.com/liujun1990/shelltweak.git
       4882b5b..880f511  master -> master
    Branch master set up to track remote branch master from origin.

    是权限验证问题,修改.git/config文件追加用户名(和密码)即可。


    参考:http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed

    To definitely be able to login using https protocol, you should first set your authentication credential to the git Remote URI:

    
    git remote set-url origin https://yourusername@github.com/user/repo.git
    
    

    Then you'll be asked for a password when trying to git push.

    In fact, this is on the http authentication format. You could set a password too:

    
    https://youruser:password@github.com/user/repo.git
    
    

    You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.


  • 相关阅读:
    node.js基础回顾
    PHP基础回顾之表单(二)
    PHP基础回顾(一)
    知识图谱Knowledge Graph
    Qt addStretch()详解
    Qt实现 QQ好友列表QToolBox
    Qt5
    用户级线程和内核级线程
    TCP状态转换图、滑动窗口、半连接状态、2MSL
    理解tcp顺序释放操作和tcp的半关闭
  • 原文地址:https://www.cnblogs.com/lixuebin/p/10814441.html
Copyright © 2011-2022 走看看