• git操作将本地的代码推送到远程仓库


    git操作将本地的代码推送到gitlab

    报错:
    1:git remote add origin https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git
    $ git remote add origin https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git
    fatal: remote origin already exists.
    原因一:远程仓库已存在,则需要删除
    git remote -v 查看远程库信息:
    git remote rm origin(删除关联的origin的远程库)
    原因二:代码目录有.git文件和gitconfig文件删除
    2:git add .
    $ git remote add origin https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git
    fatal: not a git repository (or any of the parent directories): .git
    需要git init
    3:
    $ git push -u origin master
    error: src refspec master does not match any.
    error: failed to push some refs to 'https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git'
    这里需要先: git commit -m "first commit"


    4:remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://git.stargraph.cn/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
    fatal: Authentication failed for 'https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git/'
    这里需要修改本地电脑的git仓库的凭证
    控制面板-凭证管理器-windows凭证-找到对应的git地址编辑账号密码即可

    5:git push -u origin master

    最后推送报错fatal: The remote end hung up unexpectedly,经排查是因为打包的时候target有jar包导致上传文件过大删除即可

  • 相关阅读:
    多线程并发编程
    Nexus私服仓库Linux、Windows部署教程
    实验 | RT-Thread:L1
    JWFD开源工作流-矩阵大模型的最新进展
    leetcode - 229. Majority Element II
    iApp祁天社区UI成品源码 功能齐全的社区应用
    【Linux虚拟机安装】在VMware Workstation上安装ubuntu虚拟机
    运维监控系统PIGOSS BSM 业务监控 大屏展现解析
    Redis
    【Python爬虫】urllib库——尚硅谷
  • 原文地址:https://blog.csdn.net/weixin_43152758/article/details/133631443