Git主分支没有上游分支

编程入门 行业动态 更新时间:2024-10-24 17:23:19
本文介绍了Git主分支没有上游分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将我的一个项目推送到github,但我不断收到此错误:

I'm trying to push one of my projects to github, and I keep getting this error:

fatal: The current branch master has no upstream branch.

我以前从未见过.我重新初始化了git,重新添加了源,删除并重新制作了存储库,并重新创建了SSH密钥.

I've never seen this before. I re-initialized my git, re-added my origin, deleted and re-made the repo, and recreated my SSH key.

推荐答案

在github上创建存储库;在github上添加一个README文件,然后克隆github仓库.为了获得master分支,需要创建README文件(或实际上的任何文件).

Create the repo on github; add a README file on github and then clone the github repository. Creating the README file (or any file actually) is needed in order to get a master branch.

注意创建存储库时github如何提示创建自述文件:

Notice how github prompts for creating a README when creating a repository:

更多推荐

Git主分支没有上游分支

本文发布于:2023-11-26 18:38:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634723.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分支   Git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!