git-worktree.nvim icon indicating copy to clipboard operation
git-worktree.nvim copied to clipboard

Update README to use a hidden bare repo

Open cryptomilk opened this issue 4 years ago • 7 comments

This hides the bare repo files in a .bare repository.

cryptomilk avatar Jul 23 '21 16:07 cryptomilk

interesting approach. I may not use it myself, but I do like it.

I am unsure how it will work with the plugin though. We do need to be in the git root to run. This would put you in a folder that is not quite the git root.

ThePrimeagen avatar Aug 24 '21 02:08 ThePrimeagen

have you tested this yourself? I'll do some testing in a bit.

ThePrimeagen avatar Aug 24 '21 02:08 ThePrimeagen

I'm using it with Samba ...

We also updated our scripts so it works with worktrees ... https://gitlab.com/samba-team/samba/-/commit/8858cf72af1cc15784749e58f184559a839dd4ef

cryptomilk avatar Aug 24 '21 04:08 cryptomilk

I tested this and it almost works, but I will stick to what is currently in the README.

This PR:

  • It does work fine if you use commands within a branch folder
  • It doesn't work if you use it in the root (where .bare folder is located):

Vim(lua):E5108: Error executing lua /Users/me/.vim/plugged/plenary.nvim/lua/plenary/path.lua:179: attempt to index local 'self' (a nil value)

I do like to have git files hidden and not mixed with branches.

Also - Thanks for the plugin & youtube video(s), good stuff.

meznaric avatar Oct 26 '21 21:10 meznaric

I just switched to using a .bare directory, working a fix to make it work. this in my opinion is the best way to use worktrees since all the folders in the folder are your worktrees (you do not see all the git specific stuff).

Once I get it working this PR should be changed so that both ways are presented

polarmutex avatar Nov 19 '21 05:11 polarmutex

I would like to see the README updated to show both ways of generating a bare repo and not just replacing what is there

polarmutex avatar Nov 20 '21 19:11 polarmutex

Do we need the .bare directory ?

Tested with the following, and it seemed to be working well with this plugin

git clone https://github.com/ThePrimeagen/git-worktree.nvim --bare git-worktree.nvim/.git  

ANGkeith avatar Jan 03 '22 17:01 ANGkeith