Git

git notes

  • --depth implies single-branch thus the refspec will be on single branch
    • git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
    • git fetch --depth=1 origin "+refs/heads/*:refs/remotes/origin/*"
    • git fetch origin feature/branch --depth=1 && git checkout -b feature/branch FETCH_HEAD
    • git notes add stores notes that can be mailed with git format-patch -n1 --notes under the —
      • git config notes.rewriteRef refs/notes/commits to merge notes
    • GIT_TRACE=1 git cmd for debug
  • git switch --orphan BRANCH_NAME for empty branch
  • git rev-parse --show-object-format sha1 or sha256 check
    • mostly unsupported by forges
  • git bundle for offline repo backup
    • git -c 'pack.threads=1' bundle create -q My-BUNDLE --all for deterministic bundles
  • https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_dumb_http for cloneable static file serving repo