git 如何将本地创建的repository推送到已经初始化的bitbucket repo [duplicate]

c3frrgcw  于 2023-06-20  发布在  Git
关注(0)|答案(1)|浏览(107)
    • 此问题已在此处有答案**:

Cannot push to GitHub - keeps saying need merge(31答案)
3天前关闭。
我的组织只将存储库创建权限授予管理人员,说服他们创建一个存储库需要时间和精力。当他们这样做时,他们通常使用默认选项repo初始化为.gitignore文件。这使我无法简单地使用

git remote set-url origin git@bitbucket.org:.....
git push --set-upstream origin master

给我:

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.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull结尾为:

fatal: refusing to merge unrelated histories

注意:我想保持本地目录的完整性。

8yoxcaq7

8yoxcaq71#

只要用力一推,就足够了。

git push --force

相关问题