提交指定文件夹到 git 分支

git subtree push --prefix=dist origin gh-pages
 
提交 dist 目录到 gh-pages 分支
 
 

Make sure your:

  1. --prefix folder is known to git. If needed add and commit it first.

  2. .gitignore file doesn't rule out your desired directory.

原文地址:https://www.cnblogs.com/winyh/p/14498432.html