I want to experiment with worktrees. I am investigating the possibility of git clone --bare and git clone --mirror.
git clone --mirror does something interesting it re-creates all local branches, which is something that git clone does not do which kinda sucks. However git clone --mirror has an issue for me, git log --graph --all shows no remote branches... and git branch -r also shows no remote branches. I also tried setting some refs, not sure what I am doing, tried this: $ git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/* and this: $ git config remote.origin.mirror false both on the git clone --mirror repo... which is also stored a bit strangely in reponame.git instead of .git anyway after doing git log --graph --all no remotes show up, the red things ? So how I can I use a git clone --mirror and work with remotes ? Or is this now possible or adviceable ? Another possibility would be to edit the existing git clone repo and try and move the default worktree to somewhere else. As far as I know there is no git clone command to set a different worktree for master ? What I ultimately would like to do, sort of is: git clone anyrepo. but set the master branch to \master Or perhaps \worktrees\master to make it even more clear and then another branch say feature branch \worktrees\feature So that final repo would look something like: \.git \Worktrees\Master \Worktrees\Feature I would prefer it even more if .git was in a seperate folder so full example: E:\SourceCode\Project\GitRepository.git E:\SourceCode\Project\Master E:\SourceCode\Project\Feature However the annoying thing is when git status is done on E:\SourceCode\Project it will complain and will say .git not found or whatever. Is there a way to tell git that it should look for one higher subfolder to be able to stay away from \GitRepository.git subfolder in case of accidental deletions. So that I want to delete a worktree folder and check it out, currently it's very risky to delete any worktree because .git is inside of it... I would prefer if .git repo is kept elsewhere to prevent such deletion risks/mistakes. Alternatively the above would become: E:\SourceCode\Project\.git E:\SourceCode\Project\WorkTrees\Master E:\SourceCode\Project\WorkTrees\Feature This will also do but is less ideal... longer folder names... Bye for now. Skybuck. -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/f1033918-553e-4d71-9587-31ee453026b0n%40googlegroups.com.
