1

I have deleted branches on github and did git fetch locally.

git branch -a still lists remote branches.

  • do I have to remove local remote branches manually anyway?
  • is there a way to do an automatic cleanup of local remote branches (if something is not present on github then remove local remote branch)?
2
  • 1
    Run git fetch --prune (or git fetch origin --prune or git remote update origin --prune or any of a number of similar varieties of command, all using -p or --prune). Commented Mar 15, 2016 at 7:39
  • I use an alias called "refresh-remote-branches": git config --global alias.refresh-remote-branches "remote update origin --prune" Commented Mar 15, 2016 at 16:31

1 Answer 1

2

Use git fetch origin --prune. This will remove remote tracking branches that no longer exist in the remote repository.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.