extensions/git/src/commands.ts/CommandCenter/addRemote
class CommandCenter:	async addRemote(repository: Repository): Promise<string | undefined> {
		const url = await pickRemoteSource(this.model, {
			providerLabel: provider => localize('addfrom', "Add remote from {0}", provider.name),
			urlLabel: localize('addFrom', "Add remote from URL")
		});

		if (!url) {
			return;
		}

		const resultName = await window.showInputBox({
			placeHolder: localize('remote name', "Remote name"),
			prompt: localize('provide remote name', "Please provide a remote name"),
			ignoreFocusOut: true,
			validateInput: (name: string) => {
				if (!sanitizeRemoteName(name)) {
					return localize('remote name format invalid', "Remote name format invalid");
				} else if (repository.remotes.find(r => r.name === name)) {
					return localize('remote already exists', "Remote '{0}' already exists.", name);
				}

				return null;
			}
		});

		const name = sanitizeRemoteName(resultName || '');

		if (!name) {
			return;
		}

		await repository.addRemote(name, url.trim());
		await repository.fetch({ remote: name });
		return name;
	}