繁体   English   中英

Git Push错误| 位桶存储库

[英]Git Push Error | Bitbucket Repository

我们试图将本地内容推送到“ 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.

你们可以在这方面帮助我们吗?

我只是遇到了同样的问题,这可能会对您有所帮助:

#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

看起来非常像您未能运行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

您可以尝试git push --mirror url-of-your-bitbucket-remote您的git push --mirror url-of-your-bitbucket-remote

我错误地跟随了“ i”的来历。

git remote add orign url

仅在使用以下命令查看时查找

git remote -v

并使用删除它

git remote remove orign

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

git remote add origin url

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM