bitbucket - git push 在 bitbucket 存储库上不起作用
问题描述
我刚刚在我的 Bitbucket 帐户上创建了一个存储库。我的笔记本电脑上已经写了一个代码。这是我在终端上执行的命令:
git init
git add --all
git commit -m 'Initial commit'
git remote add origin https://<repo_owner_name>@bitbucket.org/<teamname>/<reponame>.git
git push origin master
我收到以下错误:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://bitbucket.org/EtienneVergne/disney-app-proposal.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
我已经按照消息中的建议尝试了几次 git pull ,但没有成功。
有人可以帮助我吗?
解决方案
这是因为远程仓库和本地仓库不同步。
查看错误日志提示的内容
做这个:
git pull origin master
git push origin master
或
git push -f origin master
覆盖远程更改。
推荐阅读
- firebase - Firebase 规则:仅在满足资源属性条件时才允许读取
- angular - spring boot angular csrf令牌握手错误
- android - 行高和滚动的 GridView 问题 - Android Kotlin
- javascript - 在 RoR 上通过 javascript 添加动态字段
- javascript - 如何在本机反应中编辑平面列表项
- python - 使用 PyMongo 从 MongoDB 检索和显示图像
- list - SwifUI - 如何删除卡片样式的列表行背景颜色
- google-sheets-formula - 如果单元格值与 W/和语句 Google 表格匹配,则查询公式
- c# - 如何从某个索引开始替换字符串中的字符
- javascript - 如何将计时器更改为记忆游戏的倒数计时器