{"thread":{"id":"42124","subject":"Allow worktree in same path with different gitdir","startedAt":"2016-04-23T19:41:29Z","lastAt":"2016-04-23T19:41:29Z","messageCount":1,"participants":["Carlos Pita"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"284230","messageId":"CAELgYheYazk+O1a9DH2ZbR4FgcuOTwa+Y+h_gfRs8w+e58rWNw@mail.gmail.com","threadId":"42124","inReplyTo":null,"subject":"Allow worktree in same path with different gitdir","fromName":"Carlos Pita","fromEmail":"carlosjosepita@gmail.com","sentAt":"2016-04-23T19:41:29Z","receivedAt":"2016-04-23T19:41:29Z","isPatch":false,"sender":{"key":"carlosjosepita@gmail.com","avatar":"https://gravatar.com/avatar/cf95d94f5258e3cbf21c26fb6fee0d7b16a1b26b6a19e33c805527c598197321?d=mp&s=160"},"body":"Hi all,\n\nI usually keep my dotfiles, scripts, etc. in a git repo at ~, both as\na backup solution and as a way to sync config between my different\ncomputers and remote servers in which I have to work. Some of these\ncomputers require a small number of local configurations that I like\nto keep in a repo too (mainly for backup purposes). These\nmodifications to the base repo may be made branches of the base\nconfiguration but then keeping the common configurations in sync\nbetween all branches becomes cumbersome and error prone, with a lot of\nrebasing, cherry picking, stashing and whatnot. What I prefer is to\ncreate an orphan branch for local files, create a worktree for this\nbranch, then move this worktree gitdir to something like ~/.gitlocal,\nnext to the main ~/.git, update .git/worktrees to avoid pruning and\ndefine a handy alias like lgit='GIT_DIR=~/.gitlocal git'. This way I'm\nable to keep some files below ~ in a specific branch and some others\nin a shared master branch, all at the same time and in the same\ndirectory. What I find a bit cumbersome about this workflow is the\ninability to directly create the worktree at . specifying a gitdir\nlike .gitlocal. Is there any fundamental reason this is not allowed\nfor the worktree subcommand? If not, please consider this a feature\nrequest.\n\nNotice the same is valid for cloning the ~ repo, instead of just\ncreating a worktree from it. The clone subcommand will also reject a .\npath and also doesn't provide a way to specify a different gitdir\n(even --separate-git-dir requires a \"fake\" .git).\n\nCheers\n--\nCarlos\n"}]}