P10.标签与diff

1标签

$ git status
On branch dev
nothing to commit, working tree clean

$ git tag v1.0

$ git tag -a V1.0.1 -m "1.0.1 released"

$ git tag
V1.0.1
v1.0


$ git tag -l 'v*'
v1.0

$ git tag -d V1.0.1
Deleted tag 'V1.0.1' (was 9056726)

$ git tag
v1.0

git blame

$ git blame -- readme
2141d15c (zhanghuan 2020-07-23 22:45:27 +0800 1) I am zhanghuan
15c67675 (zhanghuan 2020-07-23 22:46:28 +0800 2) I am ss
37fbefd1 (zhanghuan 2020-07-24 23:24:51 +0800 3) I I I
b9c8e8a5 (zhanghuan 2020-07-24 23:25:36 +0800 4) EEE
9a1bf6e3 (zhanghuan 2020-07-25 09:50:51 +0800 5) old
efbfc2ac (zhanghuan 2020-07-25 09:52:51 +0800 6) hello
efbfc2ac (zhanghuan 2020-07-25 09:52:51 +0800 7) git stash

$

2 diff

$ cat readme
I am zhanghuan
I am ss
I I I
EEE
old
hello
git stash

$ vi readme

$ git diff readme
diff --git a/src/readme b/src/readme
index 31a56f7..4331e74 100644
--- a/src/readme
+++ b/src/readme
@@ -1,7 +1,2 @@
-I am zhanghuan
-I am ss
-I I I
-EEE
-old
-hello
 git stash
+add test

$ git add readme

$ git commit -m 'commit'
[dev 46759b7] commit
 1 file changed, 1 insertion(+), 6 deletions(-)


$ git diff readme


$ git diff HEAD

$ git diff HEAD^
diff --git a/src/readme b/src/readme
index 31a56f7..4331e74 100644
--- a/src/readme
+++ b/src/readme
@@ -1,7 +1,2 @@
-I am zhanghuan
-I am ss
-I I I
-EEE
-old
-hello
 git stash
+add test

$ git diff --cached

$ vi readme

$ git add readme

$ git diff --cached
diff --git a/src/readme b/src/readme
index 4331e74..9dda231 100644
--- a/src/readme
+++ b/src/readme
@@ -1,2 +1,3 @@
 git stash
 add test
+dd

©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页