Skip to content

Add new remote option when publishing branch#71434

Merged
joaomoreno merged 1 commit intomicrosoft:masterfrom
jmbockhorst:branchRemote
Oct 17, 2019
Merged

Add new remote option when publishing branch#71434
joaomoreno merged 1 commit intomicrosoft:masterfrom
jmbockhorst:branchRemote

Conversation

@jmbockhorst
Copy link
Contributor

Added the ability to add a new remote when publishing a branch. Closes #71242. Here is an example of creating a new branch, selecting the publish branch command, and creating a new remote. The branch gets published to that new remote.

publishBranch

I had a few questions about some ways to make the remote experience more consistent:

  • Should the ability to add a remote be an option on the "Push to.." and "Pull from..." menus as well?
    Screenshot (19)

  • Should the remotes on the "Publish branch" command show the remote URL, like the "Push to.." and "Pull from..." menus do?
    Screenshot (20)_LI

@joaomoreno joaomoreno added this to the Backlog milestone Apr 1, 2019
@joaomoreno joaomoreno added the git GIT issues label Apr 1, 2019
if (choice === addRemote) {
const newRemote = await this.addRemote(repository);

if (newRemote) {
Copy link

@mgyongyosi mgyongyosi Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "if" statement can be inverted.

if (!newRemote) {
    return;
}
     
remote = newRemote;

@joaomoreno
Copy link
Member

Thanks! 🍻

I've added this to the Push to... command as well, since it was pretty straightforward. I've also added the URL to the option description in quick pick.

@joaomoreno joaomoreno merged commit 282c57b into microsoft:master Oct 17, 2019
@joaomoreno joaomoreno modified the milestones: Backlog, October 2019 Oct 17, 2019
@rkeithhill
Copy link

rkeithhill commented Nov 24, 2019

Great. Now I have to pick origin every time I publish? If you only have one remote, there is no reason to prompt for a publish. Guess I'll go back to using the terminal and git push -u. :-(

@joaomoreno
Copy link
Member

@rkeithhill I already reverted this in master.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Pick a remote to publish the branch to" should have a "new branch" option

5 participants