https://github.com/mrloop/telescope-git-branch.nvim
Find which files and preview what changes have been made on your git branch across multiple commits
https://github.com/mrloop/telescope-git-branch.nvim
feature-branch git lua neovim nvim telescope-extension telescope-plugin
Last synced: 3 months ago
JSON representation
Find which files and preview what changes have been made on your git branch across multiple commits
- Host: GitHub
- URL: https://github.com/mrloop/telescope-git-branch.nvim
- Owner: mrloop
- License: mit
- Created: 2024-07-05T11:40:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-08T16:20:54.000Z (about 1 year ago)
- Last Synced: 2025-04-01T08:11:40.579Z (3 months ago)
- Topics: feature-branch, git, lua, neovim, nvim, telescope-extension, telescope-plugin
- Language: Lua
- Homepage:
- Size: 4.88 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim-sorted - mrloop/telescope-git-branch.nvim
- awesome-neovim-sorted - mrloop/telescope-git-branch.nvim
README
# telescope-git-branch
*Telescope Git Branch* is a [Telescope](https://github.com/nvim-telescope/telescope.nvim) extension that searches a Git branch for files which are different from the default branch, previews a diff of the changes and allows you to open files that are different from the default branch.
The [telescope-git-branch.nvim](https://github.com/mrloop/telescope-git-branch.nvim) extension is great for working with feature branches, where you want to easily see the differences between the default branch and the feature branch. It lets you search for differences across multiple commits on the same branch.
## 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
{
'mrloop/telescope-git-branch.nvim'
}
```**vim-plug**
```VimL
Plug 'https://gitlab.com/mrloop/telescope-git-branch.nvim'
```## Usage
Activate the custom Telescope commands and `git_branch` extension by adding
```lua
require('telescope').load_extension('git_branch')
```somewhere after your `require('telescope').setup()` call.
This is typically all you need to configure the plugin.The following `Telescope` extension commands are provided:
```VimL
:Telescope git_branch
```These commands can also be used from your `init.lua`.
For example, to bind `files` to `gf` use:
```lua
-- Search for the files with differences to default branch.
vim.keymap.set({'n', 'v'}, 'gf', function()
require('git_branch').files()
end)
```