zoukankan      html  css  js  c++  java
  • Git

    执行git push命令异常,如下:

    git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/master:refs/heads/master 
    Pushing to https://github.com/gongyuhonglou/PlaylistVaporServer_Swift.git
    fatal: could not read Username for 'https://github.com': Device not configured
    Completed with errors, see above

    原因:

    .git文件下     config文件中url/pushurl没有用户身份信息:

    [core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
    [remote "origin"]
        url = https://github.com/gongyuhonglou/PlaylistVaporServer_Swift.git
        fetch = +refs/heads/*:refs/remotes/origin/*
        pushurl = https://github.com/gongyuhonglou/PlaylistVaporServer_Swift.git
    [branch "master"]
        remote = origin
        merge = refs/heads/master

    解决:

    在请求串中加入身份信息即可,格式为:

    https://[userName]:[password]@github.com/[username]/project.git

    修改后:

    [remote "origin"]
         url = http://gongyuhonglou:000000@github.com/gongyuhonglou/PlaylistVaporServer_Swift.git
         fetch = +refs/heads/*:refs/remotes/origin/*

    注:000000代表密码

    如果还是不能解决的话,就在终端操作git push:(提示手动输入github账号和密码)

    macdeMacBook-Pro:Vapor mac$ git push
    Username for 'https://github.com': github账号
    Password for 'https://wengrp@yeah.net@github.com': github密码
    Counting objects: 3, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (2/2), done.
  • 相关阅读:
    成年人的快乐
    90后家庭的宠物
    计算机科学与技术易错知识点需记篇
    微机原理与接口编程技术2020 考试大纲知识点超细总结
    84.手写一个类的继承
    83.对前端路由的理解?前后端路由的区别
    81.$(document).ready()方法和window.onload有什么区别?
    80.浏览器是如何渲染页面的
    77、常用的拖拽事件
    75.json和jsonp的区别?
  • 原文地址:https://www.cnblogs.com/gongyuhonglou/p/9024315.html
Copyright © 2011-2022 走看看