0

Using Windows for development, Debian for servers and repos, Git Extensions as Git client.

I have the following repos:

REPO1:

ROOT_OF_SITE1/

REPO2:

ROOT/
    /SITE1/
    /SITE2/
    /SITE3/

SITE2 and SITE1 share the same code base, just SITE1 is a few commits ahead, but since the path is different can not cherry pick commits from SITE1 from REPO1 to SITE1 in REPO2.

I suppose one of the solutions is to convert SITE2 subdirectory to Git submodule, so then I could cherry pick commits from SITE1.

However each time I use git submodules, I'm facing problems in Git Extensions.

Unfortunately the Git Extensions Git client does not support subtree at this time.

4
  • Show how you use submodules Commented Nov 18, 2019 at 17:59
  • How to show? I just remember, that I had problems with Git Extensions and submodules together. Commented Nov 18, 2019 at 18:15
  • You ran some commands, right? What were they? Commented Nov 18, 2019 at 18:44
  • Usually I used Git Extensions GUI to create submodules. Commented Nov 18, 2019 at 19:15

1 Answer 1

1

I would use one repo with SITE1 and I would split the rest of sites using git subtree. You can divide your repo in different branches, keeping several modules organized with a quite clean tree:

git subtree split --prefix=site2 -b site2

Check this post for further information. You can then build the tree back leaving a really nice git history.

Sign up to request clarification or add additional context in comments.

4 Comments

Unfortunately Git Extensions git client does not support subtree at this time.
You can use Git bash or similar and the command line
I did read the subtree article and I found it very useful: tsh.io/blog/… I will try subtree from command line.
I did not try myself in-depth but people says is awesome and they recommend the use of git subtree instead of git submodule

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.