Skip to content
This repository was archived by the owner on Nov 25, 2022. It is now read-only.

Add checkout.defaultRemote=origin #131

@salcode

Description

@salcode

When I have more than one remotes and try to do something like

git switch feature/improve-visibility

where the branch feature/improve-visibility exists on the remote(s) but not on my local, I get a failure like the following.

hint: If you meant to check out a remote tracking branch on, e.g. 'origin',
hint: you can do so by fully qualifying the name with the --track option:
hint:
hint: git checkout --track origin/
hint:
hint: If you'd like to always have checkouts of an ambiguous prefer
hint: one remote, e.g. the 'origin' remote, consider setting
hint: checkout.defaultRemote=origin in your config.
fatal: 'feature/improve-visibility' matched multiple (2) remote tracking branches

It sounds like we can set this in our config. And since origin is almost always what we want, that should work well.

checkout.defaultRemote=origin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions