Subject: RE: Help with Git Subtree Push

From: <[email-masked]>
Date: Fri, 3 Jan 2025 13:21:50 -0500

On January 3, 2025 12:28 PM, Ankit Agarwal wrote:
>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:[email-masked]: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:[email-masked]:MSILDigital/MSIL-EDS-Transformation.git feature-branch  
>
>It fails to create the feature-branch in the external repository: mailto:[email-masked]:MSILDigital/MSIL-EDS-Transformation.git.
>To debug, we executed the command with --debug enabled:
>git subtree push --prefix=commons mailto:[email-masked]:MSILDigital/MSIL-EDS-Transformation.git feature-branch --debug  
>
>Here are the relevant logs:
>command: {push}
>quiet: {}
>dir: {commons}
>opts: mailto:[email-masked]:MSILDigital/MSIL-EDS-Transformation.git feature-branch}
>git push using:  mailto:[email-masked]: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, [email-masked]
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