worktree add already exists
- From
- Ingo Wolf <ingo.wolf@gmx.de>
- Date
- May 27, 2019, 15:32 UTC
- Message-ID
- <ad2ff81a-d75e-1ac4-07d0-c807a2ed9e36@gmx.de>
x@y MINGW64 ~/gittest $ ls bare/ barework/
x@y MINGW64 ~/gittest $ ls -a barework ./ ../ test.txt
x@y MINGW64 ~/gittest $ git -C bare branch * master
x@y MINGW64 ~/gittest $ git -C bare worktree add --no-checkout ../barework Preparing worktree (new branch 'barework') fatal: '../barework' already exists
x@y MINGW64 ~/gittest $ git -C bare branch barework * master
Why this doesn't just work and if not why is barework branch made then, why at all ?
I would like to attach an existing dir to git (make it a workdir) and then update the index with git reset and checkin the differences.
I can do that tricking around with a little dir renaming, new empty dir, move the .git file and rename back...