jesseduffield / jesseduffield/lazygit

Deleted remotes are still listed despite not being present in local .git folder

Open
#4,010 4 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Describe the bug**
When looking at the remotes list, it shows a lot of remotes that I have deleted. When looking at `.git/refs/remotes` the deleted remotes are indeed not present so I don't know why it lists all those remotes.

**To Reproduce**
I'm not entirely sure of an easy way to reproduce this. I'm trying to transition from gitkraken to lazygit and the remotes were deleted using gitkraken so I'm not sure what the exact steps would be.

**Expected behavior**
Shows only the list of remotes that still exist locally.

**Screenshots**
left-side is the .git/refs/remotes folder and right-side is the lazygit remotes view

![image](https://github.com/user-attachments/assets/c48c3061-e025-4a66-b844-c3fc5f921169)

All the remotes with `0 branches` are remotes that I deleted over many years. I tried using the delete function of lazygit but all I get is an error saying the remote doesn't exist.

![image](https://github.com/user-attachments/assets/3ce102d7-6763-4222-9d63-3c34dfb2713c)

**Version info:**
lazygit: `commit=611fabde11d24d9acc71ee26077b9a1101f59f27, build date=2024-09-18T10:56:10Z, build source=binaryRelease, version=0.44.1, os=windows, arch=amd64, git version=2.38.1.windows.1`

`git version 2.38.1.windows.1`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.