mhutchie / vscode-git-graph

View a Git Graph of your repository in Visual Studio Code, and easily perform Git actions from the graph.
https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
Other
1.89k stars 243 forks source link

Deleted remote branches still show up in Git Graph #815

Closed LBF38 closed 1 month ago

LBF38 commented 2 months ago

Describe the Bug The remote branches already deleted on the remote git platform (GitHub, GitLab or others) still show up in the Git Graph and can easily clutter the whole interface. Thus, it would be nice if the extension could detect deleted remote branches and refresh the view based on the received data.

Steps to Reproduce Steps to reproduce the behaviour:

  1. Clone a repo
  2. Open Git Graph and see remote branches
  3. Go to the remote Git platform of this repo
  4. Delete a remote branch for testing it
  5. Return in the Git Graph extension locally and refresh view
  6. See that the deleted remote branch is still shown by the extension

Expected Behaviour When a branch is deleted, remotely or locally, it should be updated/reflected in the Git Graph view.

Environment

Screenshots (optional) Add any screenshots showing the bug.

Additional Context (optional) Add any other context about the problem here.

phil294 commented 2 months ago

you probably need to uncheck the reflog option which does this

LBF38 commented 2 months ago

how do you change this setting ? I have tried checking or unchecking the include commits only mentioned by reflogs but it doesn't do anything, I still see all the remote branches that should be deleted in the local Git Graph extension in VS Code.

phil294 commented 2 months ago

oh ok in this case I don't know.

I'd just guess they aren't really deleted or the fetching process fails, perhaps due to missing authentication... maybe try fetching the remotes to see if any errors arise, other than that no idea

manuel-garnier commented 1 month ago

You need to add --prune argument when fetching. This is part of git functionality and not really a bug in git graph. You can configure git to automatically prune during fetch.

See https://git-scm.com/docs/git-fetch/en#_pruning and especially the config fetch.prune

LBF38 commented 1 month ago

You need to add --prune argument when fetching. This is part of git functionality and not really a bug in git graph. You can configure git to automatically prune during fetch.

See https://git-scm.com/docs/git-fetch/en#_pruning and especially the config fetch.prune

Thanks for the tips ! It works as expected, thank you !