You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SVN迁移至Git推送裸仓库报错:No refs in common

Fixing "No refs in common and none specified" When Pushing to Bare Git Repository

Hey there, let's sort out this push error you're facing during your SVN-to-Git migration! That error message is Git's way of saying it doesn't know which branch you want to push, and right now your local repo and the bare repo don't share any common references. Here's how to fix it step by step:

  • First, confirm your local branches
    Run this command to see what branches exist in your local migrated repo:

    git branch -a
    

    You’ll likely see a master (or main, depending on your Git version setup) branch from your SVN migration work.

  • Push your branch explicitly
    Instead of just running git push bare, specify the exact branch you want to push. For example, if your main branch is master, use this command:

    git push bare master:master
    

    The local-branch:remote-branch format tells Git exactly which local branch to sync to which branch in the bare repository.

  • Set an upstream branch for easier future pushes (optional)
    If you want to skip specifying the branch every time, set up an upstream association between your local branch and the bare repo's branch:

    git branch --set-upstream-to=bare/master master
    

    Now you can just run git push later, and Git will automatically push your local master branch to the bare repo's master branch.

Quick sanity check: Double-check that your bare repository was created with git init --bare—if it was initialized as a regular non-bare repo, that could also cause unexpected push issues.

内容的提问来源于stack exchange,提问作者Manvi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:34:47