DEV Community

Discussion on: Git Explained: Proper Team Etiquette

Collapse
 
marianban profile image
Marian Ban • Edited

Thanks for putting it together. git fetch --prune --all is a very useful command and it is also possible to automate this process with git config remote.origin.prune true It deletes branches when you do a git pull/fetch if they were deleted on the remote.

EDIT: Actually I misunderstood the prune command a bit 😅 The prune option will only delete remotely deleted references in your working tree under remotes/* . Your local branches will be kept and you have to still delete them manually with git branch -d.

Collapse
 
milu_franz profile image
Milu

Nice! I haven't you used that configuration before. I'm excited to try it out :)

Collapse
 
aerosoul profile image
Daniel Liuzzi

Or simply git config --global fetch.prune true if you want this in all your repos.