Skip to content
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

feat(switch): change --branch to --create #626

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

mlcui-corp
Copy link
Collaborator

git branch uses --branch to create a new branch, but git switch uses --create. This PR changes git-branchless switch to match git switch.

`git branch` uses `--branch` to create a new branch, but `git switch`
uses `--create`.
@mlcui-corp
Copy link
Collaborator Author

By the way, feel free to close this if users are used to -b / --branch! git switch has quite a different interface to git checkout, and I feel like it's probably best to match what git switch does instead of git checkout for git-branchless switch.

@arxanas
Copy link
Owner

arxanas commented Nov 7, 2022

@mlcui-google thanks for the fix! Originally, this command was git branchless checkout, so it matched the interface of git checkout. Now it's better to match git switch, like you noticed.

It's slightly unfortunately because git branchless switch also lets you switch to commits, not just branches, so the flag --create becomes ambiguous (is it creating a commit or a branch?). But I doubt anyone will be confused.

@arxanas arxanas merged commit fbe7766 into arxanas:master Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants