# Help with Git Subtree Push

3 messages from 2025-01-03 to 2025-01-04. Participants: Ankit agarwal, rsbecker@nexbridge.com.
Thread: https://gitlist.dev/t/62733

## Ankit agarwal, 2025-01-03 17:27

Subject: Help with Git Subtree Push
Message-ID: <CADQbHxG_dop-Lti7N9Uh02YeRuFt9apXTXWRVQb47kHOSCmKgw@mail.gmail.com>
URL: https://gitlist.dev/e/CADQbHxG_dop-Lti7N9Uh02YeRuFt9apXTXWRVQb47kHOSCmKgw%40mail.gmail.com

```
Hi All,

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: 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 git@github.com:MSILDigital/MSIL-EDS-Transformation.git
> feature-branch


It fails to create the *feature-branch* in the external repository:
git@github.com:MSILDigital/MSIL-EDS-Transformation.git.

To debug, we executed the command with --debug enabled:

git subtree push --prefix=commons
git@github.com:MSILDigital/MSIL-EDS-Transformation.git
> feature-branch --debug


Here are the relevant logs:

command: {push}
> quiet: {}
> dir: {commons}
> opts: {git@github.com:MSILDigital/MSIL-EDS-Transformation.git
> feature-branch}

git push using:  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.

-- 
Thanks and regards,
Ankit Agarwal
+91-8588910651

```

## rsbecker@nexbridge.com, 2025-01-03 18:21

Subject: RE: Help with Git Subtree Push
Message-ID: <059601db5e0c$5efbcb60$1cf36220$@nexbridge.com>
URL: https://gitlist.dev/e/059601db5e0c%245efbcb60%241cf36220%24%40nexbridge.com
In-Reply-To: <CADQbHxG_dop-Lti7N9Uh02YeRuFt9apXTXWRVQb47kHOSCmKgw@mail.gmail.com>

```
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: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


```

## Ankit agarwal, 2025-01-04 04:49

Subject: Re: Help with Git Subtree Push
Message-ID: <CADQbHxHrF04wqdvsoA47FB29idV-amk=sf8mLpQmmMHCHnuUcQ@mail.gmail.com>
URL: https://gitlist.dev/e/CADQbHxHrF04wqdvsoA47FB29idV-amk%3Dsf8mLpQmmMHCHnuUcQ%40mail.gmail.com
In-Reply-To: <059601db5e0c$5efbcb60$1cf36220$@nexbridge.com>

```
Hi All,
Thanks  for the recommendations.
Adding @apenwarr here as well.
To reiterate the details again.

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: 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 git@github.com:MSILDigital/MSIL-EDS-Transformation.git
> feature-branch


It fails to create the *feature-branch* in the external repository:
git@github.com:MSILDigital/MSIL-EDS-Transformation.git.

To debug, we executed the command with --debug enabled:

git subtree push --prefix=commons
git@github.com:MSILDigital/MSIL-EDS-Transformation.git
> feature-branch --debug


Here are the relevant logs:

command: {push}
> quiet: {}
> dir: {commons}
> opts: {git@github.com:MSILDigital/MSIL-EDS-Transformation.git
> feature-branch}

git push using:  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.

--
Thanks and regards,
Ankit Agarwal
+91-8588910651



On Fri, Jan 3, 2025 at 11:51 PM <rsbecker@nexbridge.com> wrote:

> 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:
> 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
>
>

```
