Skip to content

Reconsider the use of -B for the git checkout of remote branches #1368

Open
@jtpio

Description

@jtpio

As noticed in #1352, the git checkout command run when clicking on a remote branch uses the -B flag, which can be quite disruptive as it implies forcing the switch to the branch: https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt--Bltnew-branchgt

cmd = ["git", "checkout", "-B", local_branchname, branchname]

For now this was mitigated in #1366 with the addition of a confirmation dialog, to warn users of potential data loss.

It could however be interesting to still be able to check out remote branches via the UI, and be able to switch back to a local branch, without losing data, and similar to the workflow available via the git command directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions