git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: Help with Git Subtree Push

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Jan 3, 2025, 18:21 UTC
Message-ID
<059601db5e0c$5efbcb60$1cf36220$@nexbridge.com>
In-Reply-To
<CADQbHxG_dop-Lti7N9Uh02YeRuFt9apXTXWRVQb47kHOSCmKgw@mail.gmail.com>
On January 3, 2025 12:28 PM, Ankit Agarwal wrote:
Show 40 quoted lines
>We are currently facing an issue with the use of git subtree in our project. Below is the structure of our main repository:
>Main Repository  
>-src  
> ├── java
>  ├── test  
>-commons (git subtree linked to external repository: mailto:git@github.com:MSILDigital/MSIL-EDS-Transformation.git)  
>-README.MD  
>
>When attempting to perform a git subtree push from the main repository using the following command:
>git subtree push --prefix=commons mailto:git@github.com:MSILDigital/MSIL-EDS-Transformation.git feature-branch  
>
>It fails to create the feature-branch in the external repository: mailto:git@github.com:MSILDigital/MSIL-EDS-Transformation.git.
>To debug, we executed the command with --debug enabled:
>git subtree push --prefix=commons mailto:git@github.com:MSILDigital/MSIL-EDS-Transformation.git feature-branch --debug  
>
>Here are the relevant logs:
>command: {push}
>quiet: {}
>dir: {commons}
>opts: mailto:{git@github.com:MSILDigital/MSIL-EDS-Transformation.git feature-branch}
>git push using:  mailto:git@github.com:MSILDigital/MSIL-EDS-Transformation.git feature-branch
>Splitting commons...
>Using cachedir: /Users/anagarwa/Desktop/Code/msil/arena/.git/subtree-cache/97237
>Looking for prior splits...
>  Main is: '78dfdb9f6dcc729a5f99a03b8ba061b28f4db97b'
>    Prior: 78dfdb9f6dcc729a5f99a03b8ba061b28f4db97b -> 067b015de01bd0aa8d1694b1c9c7b3b9e836e06f
>  Main is: ''
>    Squash: 7aca20022503ddc3374be82ee39089da07094a5b from 6ce1ce18cb63e5992ff4a29e9e17e92a1af1afa2
>  Main is: 'c5352df744e1eebca0eb03ae62ca8c52cd501fe0'
>    Prior: c5352df744e1eebca0eb03ae62ca8c52cd501fe0 -> f152501eeaacbcc982bf5cce28c0f3d7b843d780
>progress: 1/     199 (0) [0]
>Processing commit: 1b0c28da208f38245ba61dcfe1fbb7d0c0f0bb78
>  parents: c3f464ce8a03eb1034782b649bd1786589d2a95c
>    incorrect order: c3f464ce8a03eb1034782b649bd1786589d2a95c
>progress: 1/     199 (1) [1]
>
>The complete debug output is attached for your reference.
>Interestingly, this command works as expected for some team members.
>Could you please guide us on what might be causing this behavior and how we can resolve it to successfully execute the git subtree push?
>Looking forward to your insights.

AFAIK, git subtree is not part of standard git installations or in the base git code. It is a contribution. I would suggest contacting the contributor, apenwarr@gmail.com For assistance. At least in the CC.

You might want to consider moving to submodules in a recent git for what you are attempting.

--Randall
Previous: Ankit agarwalNext: Ankit agarwal
Message 2 of 3 in “Help with Git Subtree Push”
  1. Ankit agarwalJan 3, 2025
  2. rsbecker@nexbridge.comJan 3, 2025
  3. Ankit agarwalJan 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.