Everything is a metaphor. What a wonderful world.

0%

1. 使用strcat进行字符串拼接

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
char *firstName = "Theo";
char *lastName = "Tsao";
char *name = (char *) malloc(strlen(firstName) + strlen(lastName));
strcpy(name, firstName);
strcat(name, lastName);
printf("%s\n", name);
return 0;
}

2. 使用sprintf进行字符串拼接

1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
char *firstName = "Theo";
char *lastName = "Tsao";
char *name = (char *) malloc(strlen(firstName) + strlen(lastName));
sprintf(name, "%s%s", firstName, lastName);
printf("%s\n", name);
return 0;
}
Read more »

1. 修改上一条提交的 commit message

1
git commit --amend

2. 修改之前提交的 commit message

比如说,我想修改距此版本之前的第3条 commit message,运行

1
git rebase -i HEAD~3
Read more »

1. 安装及配置

全局安装 commitizencz-conventional-changelog

1
2
npm install -g commitizen
npm install -g cz-conventional-changelog

进入到 git 项目

1
commitizen init cz-conventional-changelog --save-dev --save-exact --force
Read more »