1

我们正在尝试将本地内容推送到“Bitbucket”中的存储库,但在提交文件后尝试“git push”时出现以下错误。

错误信息

$ git push -u origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

你们能在这方面帮助我们吗?

4

4 回答 4

4

我刚刚遇到了同样的问题,这可能对你有帮助:

#initialize git in the folder   
git init
#add remote repository (this did not work for me)
git remote add origin https://myusername@bitbucket.org/myusername/myrepo.git
#...so i changed it later (after some git add and commit commands)
git remote set-url origin https://myusername@bitbucket.org/myusername/myrepo.git
#now it worked:
git push -u origin master

如果您收到错误消息remote origin already exists,请运行以下命令:

git remote rm origin
于 2013-10-12T16:01:17.720 回答
3

看起来很像您未能运行git remote add命令。

通常这看起来像

git remote add origin ssh://git@bitbucket.org/[USERNAME]/[REPONAME].git

但是,如果您遵循此处的文档,您应该能够为您的存储库找到正确的信息:https ://confluence.atlassian.com/display/BITBUCKET/Importing+code+from+an+existing+project

于 2013-03-14T14:44:02.927 回答
0

你可以试试git push --mirror url-of-your-bitbucket-remote

于 2014-01-30T13:17:45.577 回答
0

我错误地跟随原点缺少“我”。

git remote add orign url

仅在使用以下命令查看时才发现

git remote -v

并使用删除它

git remote remove orign

并使用正确的拼写再次创建它

git remote add origin url
于 2014-05-28T14:14:13.010 回答