Your comments

As of 20.2 preview 1 #16034, I do not see any functional improvement regarding subtrees:

- Remote > Subtree > Merge / Split / Reset are never clickable, whichever commit or branch I select

- Previously, subtree merges would result in commit messages e.g. Merge remote-tracking branch 'sync-script/master' into staging, now they read Merge commit 'c73651ff26e1ba8f3d2629666a3be81e423ba454' into staging, which is useless

- On proper subtrees, the ♣ shows up only on the subtree commit right before a subtree merge, not on the merge itself.

- https://github.com/roots/trellis never had subtrees, but certain branches still show ♣

- repositories that once were subtrees and are now living alone are still recognized as subtrees, which make Smartgit refuse to merge into root…

I would love to try out the new features, but Get latest build does not get me past 20.1.2 #15161

Yes, I did initialize with `git subtree add` and the meta-information is present.

Smartgit's output reads `git.exe -c "credential.helper=C:/Program\ Files/SmartGit/lib/credentials.cmd" merge --no-ff <subtree-origin>/master`. This  does not look like it uses `git subtree`.

I didn not know `git merge -s subtree` was guessing. In any case it never guessed wrong.

When merging with the current Smartgit Merge, i.e. `git merge` without `--strategy`, sometimes, changes in certain files that lie in a subtree's root directory end up creating the file in our repository's root directory. Files in subtrees' sub-directories never created this issue and already properly merge.

git merge --strategy subtree ORIGIN/BRANCH

avoids this issue. Nothing else seems needed for merge to work.

Two more helpful links:

https://stackoverflow.com/questions/32407634/when-to-use-git-subtree

https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt

Some additional reading to help with implementation:

Hello all!


Subtree is particularly useful when working with Roots, a powerful Wordpress framework.

Documentation for Roots & its subprojects recommends installing by pulling the git repo... and deleting the .git folder. That's a shame, because we lose the power of git and every update equates to a fresh install.


The particular about this environment is that we pull Trellis, Bedrock & Sage not as dependencies, but as source the we modify. I e.g. added more steps to deploy additional software on the server. Yet we want to receive diff updates on the code, which is not possible by cutting the link to the original repos. So it makes sense to keep the entire code in a single repository. We only need to manage the path where each sub-repo is checked out, as they do not live in different subfolders.


Submodules do not work for this use case, as explained. Subtrees are an excellent tool though.

They are set up by (e.g. Sage deep down the tree):

git subtree add --prefix=site/web/app/themes/sage sage master -m "Add Sage subtree"


Good news is, once subtrees are set up through command-line, they are transparent to Smartgit! Merging updates from upstream into each respective subtree works like a charm. We only need to resolve merge-conflicts created by our own edits. The SmartGit interface does most of the work (which it could not if we had cut the link with upstream).


Sometimes the subtree path goes missing. I do not know where the error comes from yet, but that would probably be solved by a SmartGit implementation.

Please implement setting up subtrees in Smartgit, as you do for submodules and git-flow. To the looks, only the install step is missing, so it is a relatively small workload.

Thanks!