下面分别列出 Git 和 Hexo 的常用命令:
Git 常用命令
基础操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| git init
git clone <repository-url>
git status
git add <filename> git add .
git commit -m "提交信息"
|
分支管理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| git branch git branch -a
git branch <branch-name>
git checkout <branch-name> git checkout -b <new-branch>
git merge <branch-name>
git branch -d <branch-name>
|
远程操作
1 2 3 4 5 6 7 8 9 10 11 12
| git remote add origin <repository-url>
git push origin <branch-name> git push -u origin main
git pull origin <branch-name>
git fetch origin
|
查看历史
1 2 3 4 5 6 7
| git log git log --oneline git log --graph
git diff
|
Hexo 常用命令
基础命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| hexo init <folder-name>
npm install
hexo generate
hexo server hexo s -p 4001
hexo deploy
hexo clean
|
内容管理
1 2 3 4 5 6 7 8 9 10 11 12
| hexo new "文章标题" hexo new post "文章标题"
hexo new page "about"
hexo new draft "草稿标题"
hexo publish draft "草稿标题"
|
组合命令
1 2 3 4 5 6 7 8
| hexo g -d
hexo g && hexo s
hexo clean && hexo g
|
其他实用命令
1 2 3 4 5 6 7 8
| hexo list post
hexo list page
hexo version
|
常用工作流程
Git + Hexo 典型工作流
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| hexo new "新文章标题"
hexo g
hexo s
git add . git commit -m "添加新文章" git push origin main
hexo deploy
|
这些命令涵盖了日常使用 Git 和 Hexo 的大部分场景,建议根据实际需求灵活组合使用。