@@ -114,6 +114,7 @@ export class ViewCommands {
114114 commands . registerCommand ( 'gitlens.views.openChangedFileRevisions' , this . openChangedFileRevisions , this ) ;
115115 commands . registerCommand ( 'gitlens.views.applyChanges' , this . applyChanges , this ) ;
116116 commands . registerCommand ( 'gitlens.views.checkout' , this . checkout , this ) ;
117+ commands . registerCommand ( 'gitlens.views.addRemote' , this . addRemote , this ) ;
117118
118119 commands . registerCommand ( 'gitlens.views.stageDirectory' , this . stageDirectory , this ) ;
119120 commands . registerCommand ( 'gitlens.views.stageFile' , this . stageFile , this ) ;
@@ -285,6 +286,26 @@ export class ViewCommands {
285286 return Container . git . checkout ( node . repoPath , node . ref ) ;
286287 }
287288
289+ private async addRemote ( node : RemoteNode ) {
290+ const branchName = await window . showInputBox ( {
291+ prompt : "Please provide a name for the remote branch (Press 'Enter' to confirm or 'Escape' to cancel)" ,
292+ placeHolder : 'Remote branch name' ,
293+ value : undefined
294+ } ) ;
295+
296+ if ( branchName === undefined || branchName . length === 0 ) return undefined ;
297+
298+ const remoteUrl = await window . showInputBox ( {
299+ prompt : "Please provide a url for the remote branch (Press 'Enter' to confirm or 'Escape' to cancel)" ,
300+ placeHolder : 'Remote branch url' ,
301+ value : undefined
302+ } ) ;
303+
304+ if ( remoteUrl === undefined || remoteUrl . length === 0 ) return undefined ;
305+
306+ return Container . git . addRemote ( node . repo . path , branchName , remoteUrl ) ;
307+ }
308+
288309 private closeRepository ( node : RepositoryNode ) {
289310 if ( ! ( node instanceof RepositoryNode ) ) return ;
290311
0 commit comments