https://github.com/katkodeorg/telescope_worktree.nvim
Telescope extension to create git worktrees from local or remote branches
https://github.com/katkodeorg/telescope_worktree.nvim
git git-worktre lua neovim nvim telescope-ex telescope-plugin
Last synced: about 1 year ago
JSON representation
Telescope extension to create git worktrees from local or remote branches
- Host: GitHub
- URL: https://github.com/katkodeorg/telescope_worktree.nvim
- Owner: katkodeorg
- Created: 2025-03-26T07:15:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T07:54:38.000Z (about 1 year ago)
- Last Synced: 2025-03-26T08:30:04.606Z (about 1 year ago)
- Topics: git, git-worktre, lua, neovim, nvim, telescope-ex, telescope-plugin
- Language: Lua
- Homepage: https://github.com/katkodeorg/telescope_worktree.nvim
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# telescope_worktree.nvim
*telescope_worktree* is a [Telescope](https://github.com/nvim-telescope/telescope.nvim) extension that searches a Git branch (Remote or local) and creates a new worktreee in the directory specified.

The [telescope_worktree.nvim](https://github.com/katkodeorg/telescope_worktree.nvim) extension is excellent for working with feature branches, where changing the branch requires a build or compile to work with the changes. It leverages git worktrees to work on multiple branches simultaneously and independently.
The extension uses this command to create a [git-worktree](https://git-scm.com/docs/git-worktree) from the remote branch
```bash
git worktree add --track -b /
```
## Installation
You can install these plugin using your favorite vim package manager, e.g.
[vim-plug](https://github.com/junegunn/vim-plug) and
[lazy](https://github.com/folke/lazy.nvim).
**lazy**:
```lua
{ 'katkodeorg/telescope_worktree.nvim' },
```
**vim-plug**
```VimL
Plug 'https://github.com/katkodeorg/telescope_worktree.nvim'
```
## Usage
Activate the `telescope_worktree.nvim` extension by adding
```lua
{
'nvim-telescope/telescope.nvim',
dependencies = {
-- ...
{ 'katkodeorg/telescope_worktree.nvim' },
-- ...
},
-- ...
}
```
Somewhere after your `require('telescope').setup()` call add:
```lua
pcall(require('telescope').load_extension, 'telescope_worktree')
```
Example to bind it to `wt` use:
```lua
local extensions = require('telescope').extensions
vim.keymap.set('n', 'wt', function()
extensions.telescope_worktree.create_worktree()
end, { desc = '[W]ork tree [C]reate' })
```