Hexo建立的部落格的所有檔案, 剛開始是沒有.git檔案夾的.
- 首先進入
目錄下, 建立一個分支.deploy_git
hexo
git branch hexo
- 然後将該目錄下的
檔案夾複制到部落格的根目錄下, 也就是上一級目錄..git
-
在git bash下操作, 切換到hexo分支.
git checkout hexo
-
将根目錄下的檔案先建立索引, 後推送到遠端倉庫的hexo分支上.
// 将檔案添加到版本庫
git add .
// 上傳到版本庫
git commit -m "描述資訊"
// 添加遠端推送位址
git remote add <shortname> <url>
舉例: git remote add origin [email protected]:UserName/UserName.github.io.git
// 将本地倉庫的内容推送到遠端倉庫
git push origin hexo
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/