Git 常用命令

  1. 删除远程分支

    以远程 docs/wiki_patch_398272 为例

    git push --progress --porcelain origin :refs/heads/docs/wiki_patch_398272
    
  2. 从远程更新当前分支

    git pull --rebase
    
  3. 查看记录(并显示签名)

    git log --show-signature
    
  4. 查看分支树

    最推荐(简洁又够用):

    git log --graph --oneline --decorate
    

    极简版(只看结构):

    git log --graph --oneline --decorate --all
    

    自定义格式(可读性最佳):

    git log --graph --pretty=format:'%C(yellow)%h%C(reset) %C(green)%d%C(reset) %s' --all
    

    带时间但仍简洁:

    git log --graph --pretty=format:'%C(yellow)%h%C(reset) %ad %C(green)%d%C(reset) %s' --date=short
    
Author: ismdeep
License: Copyright (c) 2025 CC-BY-NC-4.0 LICENSE