Skip to content

Checkout by name without detaching #2312

Closed
@kabessao

Description

@kabessao

Is your feature request related to a problem? Please describe.
Whenever I'm about to change branches I use the "Checkout by name" menu, paste the branch name, press enter, and there is my branch, but I think this is a waste of time since this menu has a search feature, but whenever I choose the same branch on the search results it detaches, just because the result has a "origin/" at the beginning.

Describe the solution you'd like
I would want the search result to not detach my repository.

Describe alternatives you've considered
Maybe creating a separate key ("C" for example ) that does the same but doesn't detaches.

Additional context

Lets say I have a branch called "feature/new_button". Using the search results this is the command lazygit uses:
git checkout "origin/feature/new_button"

and on "Local Branches" it will show as "(HEAD detached at origin/feature/new_button)".

But if in the same prompt I write "feature/new_button" and press enter without choosing any result this is the command it uses:
git checkout "feature/new_button"

and on "Local Branches" it will show as "feature/new_button".

(I apologize for any misunderstanding that may happen. English is not my native language)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions