0x00

Summer Training Day 1.

基本命令行操作(git bash)
git基本操作
Hexo个人博客搭建

基本命令行操作(git bash)

1
2
3
4
5
6
7
8
9
10
cd(change directory) : cd + 路径
cat(查看文件) : cat + 文件名
ls(list files) : ls -a(all),ls -al
pwdprint working directory) # 显示当前目录
mkdir(make directory) : mkdir + 目录名
echo : echo "内容" >> 文件名 # 写入
mv(move) : mv "文件名" 路径 # 移动文件
rm(remove) : rm "文件名" # 删除文件
cp(copy) : cp "文件名" 路径 # 复制文件
vim # 打开vim文本编辑器

.

git基本操作

1
2
3
4
5
6
7
8
git clone + 仓库地址
git add + 文件名
git status
git reset
git commit -m "" # 一定要有
git log # 查看commit信息
git push origin master
git pull origin master

.

Hexo个人博客搭建

a) Prepare

1.Download Node.js;
2.Download Git;
3.Use your id to make respository e.g. : matteokjh.github.io;
4.Setting Github Pages as master branch;
5.SSH Key:

1
$ ssh-keygen -t rsa -C "e-mail"

open id_rsa.pub and copy to
https://github.com/settings/ssh

remember don’t copy ‘enter’
title is not important.

b) Hexo

1.Install Hexo.

1
2
3
$ npm install -g hexo-cli
$ hexo
#test

2.Setting.
open /blog/_config.yml

1
2
3
4
5
6
title: Caster
subtitle: blogging is the new sexy
description: Valar Morghulis
author: Caster K.
language: zh-Hans
timezone: Asia/Shanghai

1
url:https://matteokjh.github.io
1
2
3
4
deploy:
type: git
repo: https://github.com/matteokjh.github.io.git
branch: master

3.edit.

1
2
3
$ hexo init <folder>
$ cd <folder>
$ hexo new "title"

write sth. in /source/post/title.md

4.Release.

1
2
3
4
5
6
7
8
$ hexo s
#check on localhost:4000/
$ hexo g
#generate
#if you cannot hexo d,type this.
$ npm install hexo-deployer-git --save
$ hexo d
#deploy

Done.