【发布时间】:2025-11-21 18:05:01
【问题描述】:
我正在尝试将文件添加到我在 BitBucket 上的存储库中,但遇到了问题。
我正在使用 GIT,这是我输入的内容
$ cd lis4368/assignments
$ git remote
$ git remote -v
$ git remote rm origin
然后我输入这个(这是 BitBucket 告诉我输入的)
$ git remote add origin https://cpb09e@bitbucket.org/cpb09e/cpb09e.git
$ git push -u origin master
我不断收到此错误消息:
error: src refspec master does not match any.
error: failed to push some refs to 'https://cpb09e@bitbucket.org/cpb09e/cpb09e.git'
有人可以帮帮我吗?我已经尝试了从 git commit 到 rm -rf * 的所有方法,但我根本无法工作。
【问题讨论】:
-
git branch的输出是什么? -
在哪里可以找到 git 分支?
-
这是一个命令。
git branch- 就像git push或git remote。运行它并将输出添加到您的问题中。 -
我刚遇到这个问题,好像是我的not在默认提交消息上方添加了自定义提交消息(我想通了,为什么要写“初始提交” ,当它在下面的 Git 生成的文本中清楚地说明了同样的事情时)。当我删除 .git 目录、为 Git 重新初始化项目目录、重新添加 GitHub 远程、将所有文件添加到新阶段、在自动生成的消息上方使用个人消息提交并推送到时,问题解决了起源/主人。
标签: git bitbucket git-push refspec