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.
  • 相关阅读:
    python数据结构树和二叉树简介
    python双向链表的实现
    Python单向链表的实现
    栈和队列数据结构的基本概念及其相关的Python实现
    模型融合目录
    算法汇总目录
    一个完整的机器学习目录
    python基础-面向对象opp
    Python random模块
    python-字符串前面添加u,r,b的含义
  • 原文地址:https://www.cnblogs.com/gongyuhonglou/p/9024315.html
Copyright © 2011-2022 走看看