i have large multi-module project trying split multiple git repos. used following sequence of commands suggested this link.
# preparing split temp branch cd modules\bigproject git subtree split -p "bigproject.core" -b "subtree-bigproject-core" #rejoin wasn't used # pushing bare repo split subtree git branch --track subtree-bigproject-core origin/subtree-bigproject-core git push --all origin mkdir ..\subtree-bigproject-core cd ..\subtree-bigproject-core git init --bare cd ..\bigproject git push ..\subtree-bigproject-core subtree-bigproject-core:master # pushing subtree repo remote cd ..\subtree-bigproject-core git remote add origin git@ssh-git-xxx.domain.com:grp/module-bigproject-core.git git push --all origin # main repo, including subtree using `subtree add` cd ..\bigproject git rm -r "bigproject.core" git add -a && git commit -am "replacing bigproject.core subtree" git subtree add -p "bigproject.core" --squash \ -m "adding bigproject.core repo subtree" \ git@ssh-git-xxx.domain.com:grp/module-bigproject-core.git master # adding subtree remote repo allow subtree push/pull/merge git remote add subtree-bigproject-core \ git@ssh-git-xxx.domain.com:grp/module-bigproject-core.git please note did not use "--rejoin" during split command execution
now able make changes main project core subtree independently.
however, when try push changes container "bigproject", subtree, executing following git subtree push command, starts reading whole commit history of main container again, without recognizing subtree created history of container , added in using "add".
git subtree push -p "bigproject.core" subtree-bigproject-core/master roger suggests "pull"/"merge" necessary after adding subtree, did not work either. git subtree documentation seems suggest git subtree split --rejoin required after doing add, when execute subtree split --rejoin again prefix, starts reading whole commit history again. on 10k commits in repo history, split time taking, , leverage on ability of subtree commands move forward point of split.
what missing? after adding "bigproject.core" subtree container repo, need ability to:
- push changes container subtree repo.
- pull changes remote subtree repo container. ok squash these changes in, long changes recognize subtree has been squashed during previous "subtree add" or "subtree pull" of subtree.
update: subtree documentation confusing me. example did not cover exact scenario , not able make work case described above.
- it says --onto not required if 1 has used add, , if add used, intelligent merges subtree happen after that. in case, "add" not seem have effect of recognizing subtree created original big repo in first place.
- it says --squash used, --rejoin not recommended. mean if "--squash" used during "add", 1 not able leverage on intelligent history reconstruction subsequent pull/push/merge of subtree?
Comments
Post a Comment