How do I force a subtree push to overwrite remote changes?

后端 未结 4 1186
夕颜
夕颜 2021-01-31 08:03

We use a subtree deployment a lá this Gist to deploy a subdirectory of our Yeoman project. In our case, the branch is called production, not gh-pages.

4条回答
  •  你的背包
    2021-01-31 08:54

    I've just enhanced the answer of ele adding generic expressions <> to make it more clear:

    git push  `git subtree split --prefix  `: --force
    

    Example values

    origin
    other-origin-name
    https://github.com/full-url/of-repo
    

    Local folder relative to repo root (execute this command in root), e.g.: /dist

    master
    any-other-branchname
    

提交回复
热议问题