惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
博客园 - 叶小钗
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
D
Docker
J
Java Code Geeks
B
Blog
G
Google Developers Blog
小众软件
小众软件
博客园 - 聂微东
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
量子位
WordPress大学
WordPress大学
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
腾讯CDC
Martin Fowler
Martin Fowler
V
Visual Studio Blog
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog

Lobsters

Lunacy | Red Vice CIFSwitch: a non-universal Linux local root vulnerability RIPE NCC session fixation: poaching logins with an Atlas probe GNOME 2.20 but its Web Components Agentic Search for Context Engineering – Leonie Monigatti Garnix is shutting down [not OC] akashina.tngl.sh/jjc Concerning Emacs (and Jazz) Nitpicking the shell history scene in ‘Tron: Legacy’ What's cooking on SourceHut? Q2 2026 The tenth OpenPGP email summit Package managers that package package managers Clojure on Fennel part three: parsing WordPress at 23 Finding Miscompiles for Fun, Not Profit GitHub - creusot-rs/creusot: Creusot helps you prove your Rust code is correct. Announcing Rust 1.96.0 | Rust Blog A Love Letter to Neovim sqlite AGENTS.md Am I a Bad Friend? CSS vs. JavaScript • Josh W. Comeau Erlang Ecosystem Foundation - Supporting the BEAM community A brief note about slot access cost in Common Lisp Keyboard latency probe Rethinking the GNOME clipboard issues Back to the Building Blocks’ Building Blocks Tech Notes: Theseus: translating win32 to wasm Fast is better than slow Content-addressed Rust builds (or, what kache actually caches) Intent to Prototype: Embedding API
Converting shallow Git bundles into normal repositories
runxiyu.org · 2026-05-27 · via Lobsters

Let’s say you have a shallow Git bundle, i.e., not all referenced objects are present. How do you convert it into a normal shallow repository?

  1. Initialize the target as a bare-repo with your desired object-format.
    git init --bare --object-format=sha1 target.git && cd target.git

  2. Find the start of the pack in each bundle (version 2 packs starts with 5041 434b 0000 0002). In my case it’s byte offset 77.

  3. Extract and index the packfile, creating the .idx and .rev.
    tail -c +77 ../source.bundle | git index-pack --stdin

  4. Extract the ref OID and ref name from the bundle.
    oid="$(git bundle list-heads source.bundle | awk '{print $1}')"
    ref="$(git bundle list-heads source.bundle | awk '{print $2}')"

  5. Set the ref to the OID, and set HEAD to the ref.
    git update-ref "$ref" "$oid"
    git symbolic-ref HEAD "$ref"

  6. Indicate the shallow commit. You should use the oldest commit here. My example has a depth of 1, so I can just use the head.
    printf '%s\n' "$oid" > shallow

  7. git fsck --full, or whatever.

I think the bundle format should gain the ability to communicate shallowness. Might take it upstream when I have the time.