5 rm -rf mainline subproj
15 git branch
-m master subproj
31 git commit
-m 'main-1'
32 git branch
-m master mainline
34 git fetch ..
/subproj sub1
35 git branch sub1 FETCH_HEAD
36 git read-tree
--prefix=subdir FETCH_HEAD
38 tree
=$
(git write-tree
)
39 com
=$
(echo initial-subdir-merge | git commit-tree
$tree -p HEAD
-p FETCH_HEAD
)
41 #git commit -m 'initial-subdir-merge'
43 git merge
-m 'merge -s -ours' -s ours FETCH_HEAD
45 touch subdir
/main-sub3
46 git add subdir
/main-sub3
47 git commit
-m 'main-sub3'
51 git commit
-m 'main-2 boring'
53 touch subdir
/main-sub4
54 git add subdir
/main-sub4
55 git commit
-m 'main-sub4'
57 git fetch ..
/subproj sub2
58 git branch sub2 FETCH_HEAD
59 git merge
-s subtree FETCH_HEAD
62 split1
=$
(git subtree
split --prefix subdir
--onto FETCH_HEAD
--rejoin)
63 echo "split1={$split1}"
64 git branch split1
"$split1"
66 touch subdir
/main-sub5
67 git add subdir
/main-sub5
68 git commit
-m 'main-sub5'
71 git fetch ..
/mainline split1
72 git branch split1 FETCH_HEAD
80 split2
=$
(git subtree
split --prefix subdir
--rejoin)
81 git branch split2
"$split2"
83 touch subdir
/main-sub7
84 git add subdir
/main-sub7
85 git commit
-m 'main-sub7'
87 split3
=$
(git subtree
split --prefix subdir
--rejoin)
88 git branch split3
"$split3"
91 git fetch ..
/mainline split3
92 git branch split3 FETCH_HEAD
94 git branch subproj-merge-split3
97 git fetch ..
/subproj subproj-merge-split3
98 git branch subproj-merge-split3 FETCH_HEAD
99 git merge
-s subtree subproj-merge-split3