I'm having some problems with pushing new changes to a subtree repository, but only if that subtree repository is extracted from the original project, and then incorporated back in.
I've attached the script which creates both repositories and presents the result after subtree push. On git 2.1.4 I'm getting this (which I expect): > 8aa7433 libup > fa8ed72 initlib And on 2.14.1 I'm getting: > 738f2b8 (newfeature) libup > dec8eab Merge commit '2f78fce902520224da808c35717be4a7fac68282' as 'lib' > 7f8084a (HEAD -> master) initlib > 5a16a6d prepare > 0c365e7 initlib > 3c00ebf initial which has the whole history from the original repository which I don't want. Am I doing something wrong or is this a bug? If so, is there a workaround? -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
#!/bin/sh rm -rf proj lib git init proj git init --bare lib # initialize data cd proj echo sgdg > main.c git add . git commit -m initial mkdir lib echo gsg > lib/lib.c git add lib git commit -m initlib # create lib using subtree git subtree split -P lib --branch lib git push ../lib lib:master git branch -D lib # incorporate lib as subtree git rm -r lib git commit -m prepare git subtree add -P lib --squash ../lib master # upgrade lib echo sdgg >> lib/lib.c git commit -am libup # push lib upgrade to subtree git subtree push -P lib ../lib newfeature # test cd ../lib git log --oneline --all
