【问题标题】:mean.io push to git repomean.io 推送到 git repo
【发布时间】:2015-06-25 17:10:03
【问题描述】:

我使用

在平均堆栈 (mean.io) 上创建了一个项目
mean init

这创建了一个 git 存储库,我想将它推送到我自己在 Bitbucket 上的私有 git 存储库中。我做到了:

git remote add origin git@bitbucket.org:my_login/reponame.git
git push -u origin --all

我收到以下错误

! [remote rejected] master -> master (shallow update not allowed)

关于如何将我的本地存储库推送到 Bitbucket 上的全新远程存储库有什么建议吗?

【问题讨论】:

    标签: git bitbucket mean-stack


    【解决方案1】:

    您想在哪个分支上推送本地 repo?尝试定义每次要推送本地 repo 的远程分支。

    git push -u origin master --all
    

    如果它不起作用,请检查此答案:

    Remote rejected (shallow update not allowed) after changing Git remote URL

    【讨论】:

    • 我收到了这个错误:错误:--all can't be combined with refspecs
    【解决方案2】:
    git fetch --unshallow upstream
    

    然后

    git push -u origin --all
    

    【讨论】:

    • "git fetch --unshallow upstream" 是我需要的,但在文档中找不到。谢谢!
    • 这个配方也有助于防止来自 bitbucket 的以下错误:`! [远程拒绝] master -> master(缺少必要的对象)` - 谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-25
    • 2012-10-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多