Last active
March 19, 2018 15:52
-
-
Save hiyangguo/63cee0c4680af06da51ab8db861197f1 to your computer and use it in GitHub Desktop.
手动同步 gh-pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# 进入目录 | |
cd dir | |
git checkout --orphan new | |
# 删除原有文件 | |
git reset -- . | |
git clean -df | |
# 将资源文件复制到此目录 | |
cp -a * ./ | |
git add . | |
# 使用时间戳做 message | |
git commit -m "update in `date '+%Y-%m-%d %H:%M:%S'`" | |
# 删除 master 分支并重建 | |
git branch -D master | |
git branch -m master | |
# 强制推送到远端 | |
git push --set-upstream origin master --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment