diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 473ecbe1c19..df2100f50c2 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1273,7 +1273,7 @@ export class CommandCenter { return; } - const name = result.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-'); + const name = result.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.|\[|\]|$/g, '-'); await repository.branch(name, true); }