-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze and clone worktrees #152
Comments
I actually never used worktree before... Do you add the extra worktree folder to gita too, so that you can see both branches in We can to define a new repo type, say BTW, I am curious how did you discover this gita project? |
Just trying to optimize my workflow, you're the 2nd google result of a "manage multiple git repos" search, and then I "validated" the search against Hackernews. I think your proposal sounds good. Notice that a worktree repo is also recognizibile as its .git is not a directory but a yaml file with a gitdir entry pointing to some worktree file path under the related main repo". So perhaps I would treat as "w" only those with this characteristics (then in the cloning it's a matter of finding the repo w/ the same remote but without a "w" type from which to spin off the worktree) (or extract this info with some porcelain git command which I don't know!). |
Interesting. To make it even simpler, we can just remove url redundancies in |
I was about to ask if the 'original' and the 'branched-out' worktrees are on the same footing. It's not clear to me how one can tell which one is 'original' from the As a result, there are actually 2 type of working tree repos. Maybe we don't need to worry all these details for now. I am also curious what happens if one branches out a worktree, then |
This may not be the best approach. The git-submodule repos have this format too. In the following example, the
|
Thanks, this is a .git of a worktree:
so maybe matching the string |
I think we can simply make a
|
I've just discovered gita and it seems great, thanks a lot!
One feature that I would find useful is the following. I have a relatively large git repo of which I might need to test and maintain several branches at the same time. Instead of checking out each branch each time, I'm using worktrees: from the master/main clone, if
BRANCH=my-branch-name
, I use:to create at the parent level a sibling folder with a reasonable name and with the checked out branch inside but without replicating all the .git info.
Since I'm interested in replicating and keeping in sync my multi-repo git setup across two computers, and hence in possibly using the gita freeze/clone for this, I was wondering whether the worktree approach could be included in the freeze/clone mechanics, possibly by leveraging on the output of
git worktree list
.Happy to test or take up some coding if you can give me some pointers, if you think all this makes sense!
The text was updated successfully, but these errors were encountered: