We have git remote add origin http://...
to avoid repeating typing of actual source repo path. But how about git subtree --prefix=...
? It is hard to track, remember and unstable typing prefix path for each time when I pull/push subtree content.
Is there any built-in feature to track prefix path automatically?
git subtree allows you to nest a repository as a subdirectory inside another. It's one of the various options for managing project dependencies in Git projects. You add a subtree to an existing repository where the subtree is a reference to another repository URL and branch/tag when you wish to utilize it.
git subtree split lets you specify a rev other than HEAD. ' git push '(man) lets you specify a mapping between a local thing and a remot ref. So smash those together, and have git subtree push let you specify which local thing to run split on and push the result of that split to the remote ref.
Use git subtree split to extract the files you want to the an intermediate branch in your repository (you have already done this).
Adding a subtreeSpecify the prefix local directory into which you want to pull the subtree. Specify the remote repository URL [of the subtree being pulled in] Specify the remote branch [of the subtree being pulled in] Specify you want to squash all the remote repository's [the subtree's] logs.
There was a contrib done to address writing to a config file that was not part of the original contrib that added subtrees.
Here's a blog about it: Blog about git subtree (with config)
And here's where it was contributed on github.
I recommend if you get that branch that you merge the latest from the main github subtree contrib.
In general, I think this is a good approach. Subtrees are still evolving, and this is one of the missing links. I'd like to also see the last commit id being recorded this way and deprecate the old way of using --rejoin to detect where to start the next split from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With