How to develop with git subtree?

50 Views Asked by At

The main problem is that the git subtree doesn't work without squash. Below I have added an example where I have 2 repositories (subtree and repo1).

  1. I have added subtree repo to repo1 git subtree add --prefix subtree subtree_repo main
  2. Added new commit to subtree repo
  3. Merged new commit from subtree using command git subtree merge --prefix=subtree subtree_repo/main
  4. Now i can't push to subtree repo. Why? You can check branch temp_branch = git subtree split --prefix=subtree HEAD -b temp_branch and in new commit git subtree trying to move files. Why?

enter image description here

Expecting push to subtree repo without new commits and changes

0

There are 0 best solutions below