Change:
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.

Discussion:
"category": "Git" }, { <ins> "command": "git.branchFrom", "title": "%command.branchFrom%", "category": "Git" }, { </ins> "command": "git.deleteBranch", "title": "%command.deleteBranch%", "category": "Git"

"command.undoCommit": "Undo Last Commit", "command.checkout": "Checkout to...", "command.branch": "Create Branch...", <ins> "command.branchFrom": "Create Branch From...", </ins> "command.deleteBranch": "Delete Branch...", "command.renameBranch": "Rename Branch...", "command.merge": "Merge Branch...",

return { merge, resolved, unresolved, deletionConflicts }; } <ins> function repositoryRefsToItems(repository: Repository): Array<CheckoutItem> { const config = workspace.getConfiguration('git'); const checkoutType = config.get<string>('checkoutType') || 'all'; const includeTags = checkoutType === 'all' || checkoutType === 'tags'; const includeRemotes = checkoutType === 'all' || checkoutType === 'remote'; const heads = repository.refs.filter(ref => ref.type === RefType.Head) .map(ref => new CheckoutItem(ref)); const tags = (includeTags ? repository.refs.filter(ref => ref.type === RefType.Tag) : []) .map(ref => new CheckoutTagItem(ref)); const remoteHeads = (includeRemotes ? repository.refs.filter(ref => ref.type === RefType.RemoteHead) : []) .map(ref => new CheckoutRemoteHeadItem(ref)); return [...heads, ...tags, ...remoteHeads]; } async function inputNameForBranch(): Promise<string> { const config = workspace.getConfiguration('git'); const branchWhitespaceChar = config.get<string>('branchWhitespaceChar')!; const branchValidationRegex = config.get<string>('branchValidationRegex')!; const sanitize = (name: string) => name ? name.trim().replace(/^.|/.|..|~|^|:|/$|.lock$|.lock/||*|s|^s*$|.$|[|]$/g, branchWhitespaceChar) : name; 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) => { const validateName = new RegExp(branchValidationRegex); if (validateName.test(sanitize(name))) { return null; } return localize('branch name format invalid', "Branch name needs to match regex: {0}", branchValidationRegex); } }); return sanitize(result || ''); } </ins> enum PushType { Push, PushTo,

await repository.checkout(treeish); return true; } <del> const config = workspace.getConfiguration('git'); const checkoutType = config.get<string>('checkoutType') || 'all'; const includeTags = checkoutType === 'all' || checkoutType === 'tags'; const includeRemotes = checkoutType === 'all' || checkoutType === 'remote'; </del> const createBranch = new CreateBranchItem(this); <del> const heads = repository.refs.filter(ref => ref.type === RefType.Head) .map(ref => new CheckoutItem(ref)); const tags = (includeTags ? repository.refs.filter(ref => ref.type === RefType.Tag) : []) .map(ref => new CheckoutTagItem(ref)); const remoteHeads = (includeRemotes ? repository.refs.filter(ref => ref.type === RefType.RemoteHead) : []) .map(ref => new CheckoutRemoteHeadItem(ref)); const picks = [createBranch, ...heads, ...tags, ...remoteHeads]; </del> <ins> const picks = [createBranch, ...repositoryRefsToItems(repository)]; </ins> const placeHolder = localize('select a ref to checkout', 'Select a ref to checkout'); const choice = await window.showQuickPick(picks, { placeHolder });

} @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 })

return Promise.resolve(); } <del> return Promise.resolve(method.apply(this, [repository, ...args])); </del> <ins> return Promise.resolve(method.apply(this, [repository, ...args.slice(1)])); </ins> }); }