6 ms·
I use a subtree to maintain an open repo within a private one. It works, but why is it so slow? You change just one file and before attempting a push it seems t
by asplake 6y ago
I use a subtree to maintain an open repo within a private one. It works, but why is it so slow? You change just one file and before attempting a push it seems to scan the whole thing. I tried this recently without a network connection, pretty clear that the slow bit is entirely local.
- vaughan 6y agohttps://stackoverflow.com/questions/16134975/how-can-i-reduce-the-ever-increasing-time-to-push-a-subtree https://stackoverflow.com/questions/16134975/how-can-i-reduc... I think it's just inefficiently implemented. `git subtree` is just a shell script using other git commands. Take a look at the `--rejoin` flag.
- asplake 6y agoThanks > When you run git subtree push, it will recreate all commits for this subtree. It has to do that, as their SHA depends on the previous commit and needs those SHAs to be able to link the new commits to the old ones. It could cache that, but it doesn’t. > I guess this is the price you pay for using subtree vs. submodules. Subtree is very stateless in your repository, which is nice on the hand but causes this long computation on the other hand. Submodules store all their information, which requires you to manage it but also makes stuff like this a lot faster.