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

推荐订阅源

Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
Y
Y Combinator Blog
D
DataBreaches.Net
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
H
Help Net Security
GbyAI
GbyAI
C
Check Point Blog
L
LangChain Blog
小众软件
小众软件
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
G
Google Developers Blog
月光博客
月光博客
V
V2EX
M
MIT News - Artificial intelligence
博客园 - 叶小钗

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.