12 rm -rf mainline subproj
13 mkdir mainline subproj
21 git branch
-m master subproj
35 git branch
-m master mainline
37 git fetch ..
/subproj sub1
38 git branch sub1 FETCH_HEAD
39 git subtree add
--prefix=subdir FETCH_HEAD
41 # this shouldn't actually do anything, since FETCH_HEAD is already a parent
42 git merge
-m 'merge -s -ours' -s ours FETCH_HEAD
44 create subdir
/main-sub5
45 git commit
-m 'main-sub5'
48 git commit
-m 'main6 boring'
50 create subdir
/main-sub7
51 git commit
-m 'main-sub7'
53 git fetch ..
/subproj sub2
54 git branch sub2 FETCH_HEAD
55 git subtree merge
--prefix=subdir FETCH_HEAD
58 split1
=$
(git subtree
split --annotate='*' --prefix subdir
--onto FETCH_HEAD
--rejoin)
59 echo "split1={$split1}"
60 git branch split1
"$split1"
62 create subdir
/main-sub8
63 git commit
-m 'main-sub8'
66 git fetch ..
/mainline split1
67 git branch split1 FETCH_HEAD
74 split2
=$
(git subtree
split --annotate='*' --prefix subdir
--rejoin)
75 git branch split2
"$split2"
77 create subdir
/main-sub10
78 git commit
-m 'main-sub10'
80 split3
=$
(git subtree
split --annotate='*' --prefix subdir
--rejoin)
81 git branch split3
"$split3"
84 git fetch ..
/mainline split3
85 git branch split3 FETCH_HEAD
87 git branch subproj-merge-split3
90 git fetch ..
/subproj subproj-merge-split3
91 git branch subproj-merge-split3 FETCH_HEAD
92 git subtree pull
--prefix=subdir ..
/subproj subproj-merge-split3