diff --git a/extensions/git/package.json b/extensions/git/package.json index bd3d175c58a..e6e7d350c45 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -608,6 +608,11 @@ "type": "boolean", "description": "%config.ignoreLimitWarning%", "default": false + }, + "git.cloneDirectory": { + "type": "string", + "default": null, + "description": "%config.cloneDirectory%" } } } diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 11c7347fa07..270283993d4 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.cloneDirectory": "When cloning a new repository, the default location will be set to this directory" } \ No newline at end of file diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 399cfd10a16..a938cb31197 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 cloneDirectory = config.get('cloneDirectory') || os.homedir(); + const parentPath = await window.showInputBox({ prompt: localize('parent', "Parent Directory"), - value: os.homedir(), + value: cloneDirectory, ignoreFocusOut: true }); diff --git a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts index e35495db433..0bdf195f96c 100644 --- a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts +++ b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts @@ -235,6 +235,11 @@ export function registerContributions(): void { enum: ['all', 'local', 'tags', 'remote'], default: 'all', description: nls.localize('checkoutType', "Controls what type of branches are listed."), + }, + 'git.cloneDirectory': { + type: 'string', + default: null, + description: nls.localize('cloneDirectory', "When cloning a new repository, the default location will be set to this directory."), } } });