Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git: After adding remote, run fetch #92034

Open
BoltonBailey opened this issue Mar 4, 2020 · 3 comments · May be fixed by #94376
Open

Git: After adding remote, run fetch #92034

BoltonBailey opened this issue Mar 4, 2020 · 3 comments · May be fixed by #94376

Comments

@BoltonBailey
Copy link

@BoltonBailey BoltonBailey commented Mar 4, 2020

Not sure if this is a bug or if there is an intended way of doing this correctly in vscode that I'm missing, but the behavior I'm seeing doesn't make sense to me.

I can add a remote to my repository by using the Git: Add Remote command. If I then use the Git: Pull from... command I will see the newly added remote. However, if I select that remote I am then asked to select a branch from the remote, and when I type in the branch I want and hit enter, nothing happens.

Interestingly, if I add the remote, and then run the command "git pull REMOTENAME BRANCHNAME" in the terminal, thereafter when I run the Git: Pull from... command, when I am asked to select a branch I am shown a drop-down menu of branches I can select including those branches I have pulled from already, but no others. Removing the remote and re-adding it resets the set of branches I can pull from.

Running git remote show BRANCHNAME shows a list of branches on the remote.

Here is what I think should be improved:

  1. At a minimum, when I go to pull a remote branch I have never pulled from before, I should be able to type in the name of the new branch to pull and hit enter and have the pull work. This is a bug and perhaps related to the implementation of #37490
  2. It would be nice if, when I select the remote repo in the Git: Pull from... workflow, it auto-populates the list of branches I can pull from using the information from the git remote show command.

For the purposes of replicating the issue, my vs code version data is
Version: 1.42.1
Commit: c47d83b
Date: 2020-02-11T14:44:27.652Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.3.0

@vscodebot
Copy link

@vscodebot vscodebot bot commented Mar 4, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@joaomoreno
Copy link
Member

@joaomoreno joaomoreno commented Apr 3, 2020

I think you're missing something.

Removing the remote and re-adding it resets the set of branches I can pull from.

No, I think what happened was that there was an automatic fetch happening and suddenly the branches became available.

We should just run fetch as part of the Add Remote command.

@joaomoreno joaomoreno changed the title After adding remote, no branches are present to pull from Git: After adding remote, run fetch Apr 3, 2020
@BoltonBailey BoltonBailey linked a pull request that will close this issue Apr 3, 2020
@gjsjohnmurray
Copy link
Contributor

@gjsjohnmurray gjsjohnmurray commented Apr 30, 2020

@BoltonBailey thanks for submitting a PR.

@joaomoreno I guess it's too late for this to get into April, but please can it be merged in time for May?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.