git命令實操記錄

git log

  1. git log

  2. git log -p -1
    展開顯示最近一次的提交差異;

  3. git log --stat
    顯示簡要的函數統計

  4. git log --pretty=oneline

  5. git log --pretty=format:"%h - %an, %ar : %s"

    選項	 說明
    %H	提交對象(commit)的完整哈希字串
    %h	提交對象的簡短哈希字串
    %T	樹對象(tree)的完整哈希字串
    %t	樹對象的簡短哈希字串
    %P	父對象(parent)的完整哈希字串
    %p	父對象的簡短哈希字串
    %an	作者(author)的名字
    %ae	作者的電子郵件地址
    %ad	作者修訂日期(可以用 -date= 選項定製格式)
    %ar	作者修訂日期,按多久以前的方式顯示
    %cn	提交者(committer)的名字
    %ce	提交者的電子郵件地址
    %cd	提交日期
    %cr	提交日期,按多久以前的方式顯示
    %s	提交說明
    
  6. 時間人員過濾
    –since, --after 僅顯示指定時間之後的提交。
    –until, --before 僅顯示指定時間之前的提交。
    –author 僅顯示指定作者相關的提交。
    –committer 僅顯示指定提交者相關的提交。
    git log --before={3,weeks,ago} --after={2010-04-18}
    git log --since=“2008-10-01”
    git log --since=“2008-10-01” --author=someone


git branch

  1. git branch -a
  2. git branch
  3. git branch branchName
  4. git checkout -b branchName
  5. git push origin localBranchName
  6. git branch -d localBranchName
  7. git branch -r -d origin/branch-name; git push origin :branch-name
  8. git branch -va

git 獲取指定的tag處代碼

git checkout -b newBranchName tagName
git checkout tagName
https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8


origin

  1. git remove -v equals cat .git/config
  2. origin is an alias for your remote repository.

repo

repo使用簡介

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章