Git+中文教程(6)
时间:2026-01-20
时间:2026-01-20
Git+中文教程
Git 中文教程
$ git-checkout robin
$ echo "Work, work, workd" >> hello
$ git-commit -m "Some workd" -i hello
$ git-checkout master
$ echo "Play, play, play" >> hello
$ echo "Lots of fun" >> example
$ git-commit -m "Some fun" -i hello example
git-show-branch 命令可以使我们看到版本库中每个分支的世系发展状态,并且可以看到每次提交的内容是否已进入每个分支。
$ git-show-branch
这个命令让我们看到版本库的发展记录。
* [master] Some fun
! [robin] some work
--
* [master] Some fun
+ [robin] some work
*+ [master^] a new day for git
譬如我们要查看世系标号为 master^ 和 robin 的版本的差异情况,我们可以使用这样的命令:
$ git-diff master^ robin
我们可以看到这两个版本的差异:
diff --git a/hello b/hello
index 44c73 100644
--- a/hello
+++ b/hello
@@ -1,2 +1,3 @@
Hello World
It's a new day for git
+Work, work, work