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

后端 未结 4 1191
夕颜
夕颜 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

    There is a simpler solution

    This always works for me.

    1. Set up a bash script which helps you do the following:
    cd dist
    git init
    git add .
    git commit -am "deploy"
    git push --force  master
    rm -rf .git
    cd ..
    

    This creates a new git repository in the subdirectory you specify and force pushes everything from there.

    1. profit

提交回复
热议问题