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使用简介

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