-
-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git_branch checkout a non-local remote branch #1932
Comments
Honestly i dont get what you want. Stuff like this:
Makes helping you impossible. Do you not want to see remote branches? Do you want to track remote branches because you can do that with
We currently dont support piping. And changing the command is currently pretty much impossible because that would also result in changing some of the lua code. So you basically can just write your own picker. I am tempted to close this issue as invalid based the fact that you filled out the template that bad and i will do that in the following days unless you provide more information. |
I'm sorry I missed that field, I had hoped that I described the issue in a clear way. Reproduce
mkdir /tmp/git-branch-ts-test/
cd /tmp/git-branch-ts-test/
curl -sLO https://gist.githubusercontent.com/mosheavni/2de985493b6746b49fdf1e9ef93902b9/raw/9f7c66de2c6ce5f30c50e42ab1f03029dcdcf8ae/minimal-init.lua
cd /tmp/git-branch-ts-test/
git clone https://github.com/junegunn/fzf.git
cd fzf
nvim -nu /tmp/git-branch-ts-test/minimal-init.lua
Now you can see that the HEAD is detached which is a not wanted git behaviour. When I'm checking out to a branch I want it to be a local one tracked remotely, so basically I either wouldn't want to see branches with |
|
it does. |
our default action does We also have |
Ok, is there a way to override the mappings? telescope.nvim/lua/telescope/builtin/git.lua Line 287 in 39b12d8
not sure by this code I can. Also regarding the second sort question, this flag added to telescope.nvim/lua/telescope/builtin/git.lua Line 286 in 39b12d8
Is there a way to not sort the results? |
I'd also love to change default behavior. Rarely do I want to just checkout the commit, I most often want to switch/track. |
so strange that this is the default behavior they chose, so un-intuitive! |
I know this is a rather trivial subject, the functionality is there and I'm happy with that, but since we're here and talking about which would be more sensible... Since Adding a |
I was able to override the keybinding with telescope.setup({
pickers = {
git_branches = {
mappings = {
i = { ["<cr>"] = actions.git_switch_branch },
},
},
},
}) |
+1 to this issue |
|
+1 to this issue |
Description
On
:Telescope git_branch
I see all branches including non-localorigin/
branches (branches I still not checked out to sincegit clone
), and when I try to checkout to this branch by pressing Enter, I get HEAD detached:Also, I want to sort based on the branches with latest push, I came up with this git command:
Which I wish I could use instead of the plugin's default git branch command, here:
telescope.nvim/lua/telescope/builtin/git.lua
Line 199 in d743d70
Neovim version
Operating system and version
macOS 12.2.1
checkhealth telescope
Steps to reproduce
minimal-init.lua
file:mkdir /tmp/git-branch-ts-test/ cd /tmp/git-branch-ts-test/ curl -sLO https://gist.githubusercontent.com/mosheavni/2de985493b6746b49fdf1e9ef93902b9/raw/9f7c66de2c6ce5f30c50e42ab1f03029dcdcf8ae/minimal-init.lua
:Telescope git_branches
and choose any branch:!git status
to see what happened at checkoutNow you can see that the HEAD is detached which is a not wanted git behaviour. When I'm checking out to a branch I want it to be a local one tracked remotely, so basically I either wouldn't want to see branches with
origin/
, or having something that removes the remote prefix to check out to a local branch and not get HEAD detached at...Expected behavior
If I select a branch with name `REMOTE_NAME/XXX', I want the checkout actions to be:
Actual behavior
branches with
origin/
prefix are checked out to and HEAD detaches, behind the scenes it's probably:git checkout ${GIVEN_BRANCH}
Minimal config
https://gist.githubusercontent.com/mosheavni/2de985493b6746b49fdf1e9ef93902b9/raw/9f7c66de2c6ce5f30c50e42ab1f03029dcdcf8ae/minimal-init.lua
The text was updated successfully, but these errors were encountered: