Change:
} @command('git.branch', { repository: true }) <del> async branch(repository: Repository): Promise<void> { const config = workspace.getConfiguration('git'); const branchValidationRegex = config.get<string>('branchValidationRegex')!; const branchWhitespaceChar = config.get<string>('branchWhitespaceChar')!; const validateName = new RegExp(branchValidationRegex); const sanitize = (name: string) => { name = name.trim(); if (!name) { return name; } </del> <ins> async branch(repository: Repository, ref?: string): Promise<void> { const name = await inputNameForBranch(); </ins> <del> return name.replace(/^.|/.|..|~|^|:|/$|.lock$|.lock/||*|s|^s*$|.$|[|]$/g, branchWhitespaceChar); }; const result = await window.showInputBox({ placeHolder: localize('branch name', "Branch name"), prompt: localize('provide branch name', "Please provide a branch name"), ignoreFocusOut: true, validateInput: (name: string) => { if (validateName.test(sanitize(name))) { return null; } </del> <ins> if (!name) { return; } </ins> <del> return localize('branch name format invalid', "Branch name needs to match regex: {0}", branchValidationRegex); } }); </del> <ins> await repository.branch(name, true, ref); } </ins> <del> const name = sanitize(result || ''); </del> <ins> @command('git.branchFrom', { repository: true }) async createBranchFrom(repository: Repository): Promise<void> { const refs = repositoryRefsToItems(repository); const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create a new branch from'); const choice = await window.showQuickPick(refs, { placeHolder }); </ins> <del> if (!name) { </del> <ins> if (!choice) { </ins> return; } <del> await repository.branch(name, true); </del> <ins> await this.branch(repository, choice.label); </ins> } @command('git.deleteBranch', { repository: true })

Discussion:
Similar to the visual-studio feature: Right now the way to do this would be to checkout the remote branch and then create a branch from there !
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.678 --- <!-- score: 0.631 --- <!-- score: 0.585 --- <!-- score: 0.58 --- <!-- score: 0.53 --<!-- potentialduplicatescomment --
The command will show you a list of branches. If you pick a remote branch, it will create a local branch and set it to track the remote one. Isn't that enough?
this would require me to first checkout the remote branch
Please try <kbdF1</kbd, , pick a remote branch and let me know if that doesn't create a local branch.
it does create a local branch. I think I didn't explain the feature request correctly for example: When working on a new feature you create a branch from the remote master into your own local branch you have no need to actually create a local version of the branch. I never create a local branch tracking the remote branch
So, you want to create a branch based off a specific remote branch?
Exactly
I don't see a "Create Branch From" command, what happened to it?
The standard command now asks you where the branch should be created.
hey is there a way to set this branch to be the current branch by default?
What does that mean? When running the command, that branch will be checked out.
Sorry for not being very clear! Right now when I run this command I'm prompted to choose which branch to branch off every time. I quite liked it when the command would use the current branch as the branch to branch off of, without me having to specify it. I can see how the new behaviour is useful, but is there a way to set the old behaviour as the default behaviour, so that I don't have to confirm that I want to branch off the current branch when making a new branch?
The current experience auto selects ... so all you have to do is press <kbdEnter</kbdwhen asked which ref the branch should be created from. That is the equivalent of the old behaviour.