Workflow with git worktree with a bare repo #1507
jfvillablanca
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am testing out a new workflow where I would use git worktrees instead of git stashes.
I am fairly new to git worktree so please bear with me if I miss out on something.
This is how I intend to organize new projects:
my-awesome-project/
has three branches: bugfix, feature-branch, and main.With this organization,
.bare/
contains the bare repo (cloned from remote) and.git
just points to.bare/
.Contents of
.bare/
is essentially:Contents of
.git
Now to my question:

Since the two branches are on different folders, GitUI throws me an error if I try to checkout to another branch
Is there a way to configure GitUI or .gitconfig to work around this error?
Checking out to another branch is basically
cd
-ing to another folder but, if it's possible to not leave Neovim, that would be awesome.If you have suggestions/ideas to improve this kind of workflow, I'm all ears :)
Note:
An nvim plugin exists for git worktree on bare repos: git-worktree.nvim
I tried it, but I wanted to use GitUI as much as possible.
Beta Was this translation helpful? Give feedback.
All reactions