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

前端 未结 6 996
悲&欢浪女
悲&欢浪女 2020-11-28 02:16

I have a project under Git version control that I worked on both a server and my local computer. I originally had the remote origin set as my local computer but I would now

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 02:52

    Based on the most upvoted answer, I created an alias to automate things:

    Add to your .gitconfig:

    [alias]
        unshallow = !"git fetch --unshallow \"${1:-origin}\" # Unshallow from remote $1 (defaults to origin)"
    

    Usage:

    • git unshallow # unshallow current branch based on the origin remote
    • git unshallow other-remote # unshallow current branch from remote other-remote

提交回复
热议问题