Allow worktree in same path with different gitdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I usually keep my dotfiles, scripts, etc. in a git repo at ~, both as
a backup solution and as a way to sync config between my different
computers and remote servers in which I have to work. Some of these
computers require a small number of local configurations that I like
to keep in a repo too (mainly for backup purposes). These
modifications to the base repo may be made branches of the base
configuration but then keeping the common configurations in sync
between all branches becomes cumbersome and error prone, with a lot of
rebasing, cherry picking, stashing and whatnot. What I prefer is to
create an orphan branch for local files, create a worktree for this
branch, then move this worktree gitdir to something like ~/.gitlocal,
next to the main ~/.git, update .git/worktrees to avoid pruning and
define a handy alias like lgit='GIT_DIR=~/.gitlocal git'. This way I'm
able to keep some files below ~ in a specific branch and some others
in a shared master branch, all at the same time and in the same
directory. What I find a bit cumbersome about this workflow is the
inability to directly create the worktree at . specifying a gitdir
like .gitlocal. Is there any fundamental reason this is not allowed
for the worktree subcommand? If not, please consider this a feature
request.

Notice the same is valid for cloning the ~ repo, instead of just
creating a worktree from it. The clone subcommand will also reject a .
path and also doesn't provide a way to specify a different gitdir
(even --separate-git-dir requires a "fake" .git).

Cheers
--
Carlos
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]