Git推送错误| Bitbucket Repository

Git推送错误| Bitbucket Repository

问题描述:

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

错误消息

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

你能帮助的人我们在这方面?

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

通常这看起来像

git remote add origin ssh://[email protected]/[USERNAME]/[REPONAME].git 

但是,你应该能够找到你的资料库的正确信息,如果您按照文档的位置:https://confluence.atlassian.com/display/BITBUCKET/Importing+code+from+an+existing+project

我有同样的问题,这可能帮助您:

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

如果你得到错误信息remote origin already exists,运行此:

git remote rm origin 
+0

用正确的拼写再次创造了它谢谢! 我会补充一点:如果你得到的错误信息>致命:'远程原点已经存在。'运行'git remote rm origin' – user2673238 2016-03-25 02:11:06

+0

thanx,将马上添加! – luschn 2016-03-25 08:15:15

您可以尝试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