diff --git a/extensions/git/package.json b/extensions/git/package.json index bd3d175c58a..9bbce1ea371 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -608,6 +608,11 @@ "type": "boolean", "description": "%config.ignoreLimitWarning%", "default": false + }, + "git.defaultCloneDirectory": { + "type": "string", + "default": null, + "description": "%config.defaultCloneDirectory%" } } } diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 11c7347fa07..81188ab18a3 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -37,5 +37,6 @@ "config.countBadge": "Controls the git badge counter. `all` counts all changes. `tracked` counts only the tracked changes. `off` turns it off.", "config.checkoutType": "Controls what type of branches are listed when running `Checkout to...`. `all` shows all refs, `local` shows only the local branchs, `tags` shows only tags and `remote` shows only remote branches.", "config.ignoreLegacyWarning": "Ignores the legacy Git warning", - "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository" + "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository", + "config.defaultCloneDirectory": "The default location where to clone a git repository" } \ No newline at end of file diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 399cfd10a16..5f2ea323c1c 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -202,9 +202,12 @@ export class CommandCenter { return; } + const config = workspace.getConfiguration('git'); + const value = config.get('defaultCloneDirectory') || os.homedir(); + const parentPath = await window.showInputBox({ prompt: localize('parent', "Parent Directory"), - value: os.homedir(), + value, ignoreFocusOut: true });