Git note (TBD)

it's a note based on:
Git Book

Ch6 - Tools:



  1. $ git log --abbrev-commit
    : Simplified SHA-1 (Shortest to it's '消歧意' length)
  2. $ git show ca82a6dff817ec66f44342007202690a93763949
    $ git show topic1

    : Both for the same meaning, for query branch detail.
  3. $ git rev-parse topic1
    ca82a6dff817ec66f44342007202690a93763949

    :To check work status. Used for Git plumbing.
  4. $ git reflog
    : Record the 'HEAD' flow, along with branching history.
  5. 需要注意的是,日誌引用資訊只存在於本地——這是一個你在倉庫裡做過什麼的日誌。這些引用不會和其他人的倉庫拷貝裡的相同;當你新 clone 一個倉庫的時候,引用日誌是空的,因為你在倉庫裡還沒有操作。
  6. $ 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 方式
  7. $ git log master..experiment
    D
    C
    : Check for the branches that only 'experiment' have.
  8. $ git log experiment..master
    F
    E

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

    : Mark the file status good/bad that 'binary search-able' 

留言