跳到主要內容
it's a note based on:
Git Book
Ch6 - Tools:
- $ git log --abbrev-commit
: Simplified SHA-1 (Shortest to it's '消歧意' length)
- $ git show ca82a6dff817ec66f44342007202690a93763949
$ git show topic1
: Both for the same meaning, for query branch detail.
- $ git rev-parse topic1
ca82a6dff817ec66f44342007202690a93763949
:To check work status. Used for Git plumbing.
- $ git reflog
: Record the 'HEAD' flow, along with branching history.
- 需要注意的是,日誌引用資訊只存在於本地——這是一個你在倉庫裡做過什麼的日誌。這些引用不會和其他人的倉庫拷貝裡的相同;當你新 clone 一個倉庫的時候,引用日誌是空的,因為你在倉庫裡還沒有操作。
- $ git log --pretty=format:'%h %s' --graph
* 734713b fixed refs handling, added gc auto, updated tests
* d921970 Merge commit 'phedders/rdocs'
|\
| * 35cfb2b Some rdoc changes
* | 1c002dd added some blame and merge stuff
|/
* 1c36188 ignore *.gem
* 9b29157 add open3_detach to gemspec file list
: 圖形化的log 方式
- $ git log master..experiment
D
C
: Check for the branches that only 'experiment' have.

- $ git log experiment..master
F
E
: As the contrary for upper usage.
- $ git stash
: Want to change your HEAD branch without commit those changes you having done yet with the last branch directory.
你想切換分支,但是你還不想提交你正在進行中的工作;所以你儲藏這些變更。
- $ git stash list
: To check those you stashed
- $ git blame -L 12,22 simplegit.rb
: To take a look at modification(by whom) of each line.
- $ git bisect bad
$ git bisect good
: Mark the file status good/bad that 'binary search-able'
留言
張貼留言