How to pack a remote repository from a specific branch or commit in repomix?
How do I make repomix pack a remote repository from a specific branch or commit? I'm using repomix v0.2.6 and tried
npx repomix --remote <repo-url> --remote-branch b188a6cwith a short commit SHA, but it didn't pack the commit I wanted. Does the--remote-branchoption support commit hashes, and if so, what format is required?Originally asked on GitHub: https://github.com/yamadashy/repomix/issues/195
4 answers
Fixed in repomix v0.2.11. The
--remote-branchoption was added in v0.2.6 for packing a remote repository from a specific branch or tag, but it did not support commit hashes becausegit clone -bonly accepts branch names and tags. Support for commit SHAs was released in v0.2.11, as announced by the maintainer.Use
--remote-branchtogether with--remote:bashnpx repomix --remote https://github.com/cubiq/ComfyUI_IPAdapter_plus --remote-branch b188a6cb39b512a9c6da7235b880af42c78ccd0dA contributor tested the fix and confirmed it works with the full 40-character SHA. Short SHA prefixes (e.g.
b188a6c) do not work becausegit fetchdoes not resolve abbreviated commit hashes, so always pass the full SHA. Branch names and tags work as expected.Did this work for you?What @huy-trn tried on GitHub (Worked)
A contributor tested the fix with the full 40-character SHA
b188a6cb39b512a9c6da7235b880af42c78ccd0dand confirmed it works, while noting short hashes don't because git fetch doesn't support them.Source: https://github.com/yamadashy/repomix/issues/195#issuecomment-2558519281 (opens external site)
Did this work for you?What @darrelladjei tried on GitHub (Didn't work)
Tried
npx repomix --remote https://github.com/cubiq/ComfyUI_IPAdapter_plus --remote-branch b188a6cwith a short commit SHA; the expected commit was not packed.Source: https://github.com/yamadashy/repomix/issues/195#issuecomment-2557563758 (opens external site)
Did this work for you?What @darrelladjei tried on GitHub (Didn't work)
Ran the draft PR locally against the same ComfyUI_IPAdapter_plus example and reported it wasn't working for their use case, so they opened a separate PR with test cases.
Source: https://github.com/yamadashy/repomix/issues/195#issuecomment-2558129048 (opens external site)
Did this work for you?
Related questions
- How to pack only currently open files in VSCode with Repomix?
- Repomix: how to split packed output into multiple files for large codebases?
- Can I use multiple named configs in repomix.config.json for subdirectories?
- How do I run external commands on files before packing with repomix?
- How to set per-file inclusion levels (full, compressed, directory-only) in repomix?