6 Commits

Author SHA1 Message Date
515dd2b9c4 README is from welcome.txt: 2024-08-20 23:16:50 +02:00
7fca44eac8 commit with --amend test. 2024-08-20 23:00:34 +02:00
ce2b85da59 test a test file 2024-08-20 22:56:59 +02:00
df3218e422 delete hello.h 2024-08-20 22:52:39 +02:00
73624ddf35 add hello.h to make an experiment 2024-08-20 22:50:36 +02:00
a4039843d6 test commit amend 2024-08-20 22:30:49 +02:00
4 changed files with 55 additions and 0 deletions

1
README
View File

@@ -1,2 +1,3 @@
Hello.
Nice to meet you.
README

1
hello.h Normal file
View File

@@ -0,0 +1 @@
#include <stdio.h>

View File

@@ -98,3 +98,55 @@ git cat-file -p D^0 # 展示里程碑D及其提交
### 2.8.4.4 git diff
```bash
git diff B A # 比较B和A里程碑
git diff A # 比较工作区和里程碑A
git diff --cached A
git diff
git diff --cached
git diff HEAD
```
```bash
git diff --word-diff
```
### 2.8.4.5 git blame
可以追溯指出是谁在什么时候,什么版本引入的代码
```
git blame <filename>
git blame -L <n,m> <filename> # 查看某几行
```
### 2.8.4.6 git bisect
用于二分查找什么时候引入的代码
```bash
git bisect start # 开始二分查找
git bisect bad # 设置当前版本为坏版本
git bisect good G # 设置里程碑G为好版本
git bisect reset # 结束
```
标记错误,恢复
```bash
git bisect log > logfile # 打开logfile删除标记错误的行
git bisect reset
git bisect replay logfile # 用logfile恢复进度
```

1
test Normal file
View File

@@ -0,0 +1 @@
test