Can Git subtree remember or track prefixes automatically?
Asked Answered
B

1

6

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?

Branscum answered 11/10, 2013 at 13:10 Comment(0)
H
1

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.

Hammonds answered 6/3, 2014 at 6:48 Comment(2)
Also, I'm working on adding subtrees to tortoisegit (I haven't pushed anything yet, but I'm almost done, so keep a watch out) if you like that sort of thing then you won't have to type anything in :)Hammonds
Sorry for the necro, but here we are in 2022 and we still have to type in the path every single time, which makes the whole git subtree process feel very verbose. Is there anything new about a .gittrees config file?Oba

© 2022 - 2024 — McMap. All rights reserved.