DEV Community

Discussion on: Git Explained: Proper Team Etiquette

Collapse
 
jsn1nj4 profile image
Elliot Derhay • Edited

Nice article summarizing some good practices!

Also wanted to add there's a newer way to delete a remote branch.

git push --delete remote branch-name

This was added I think because it could be easier to understand and remember.

I'll note though that, at least in my experience, it doesn't let you tab-complete the branch name if you delete the local branch first. But it will if you delete the remote branch before deleting the local one.

However, if you do delete the local branch first, using the other method you mentioned will still let you tab-complete the remote branch name.

Not sure why tab completion doesn't work with the new way of deleting remote branches, but oh well... 🤷‍♂️

Collapse
 
milu_franz profile image
Milu

That is a great point, the branch deleting command you added is definitely easier to understand and remember. I added your suggestion to the post, thank you for bringing it up!

In regards to the issues you are having with tab-completing a branch name, I’m not sure why bash git completion does not recognize those two commands as the same, I will look into it and let you know if I find out why this is happening.

Side note, starting on Git v2.8.0 you can use git push with the -d option as an alias from —delete, in case you like this shortcut better.

Thank you again for reading and providing suggestions! :)

Collapse
 
jsn1nj4 profile image
Elliot Derhay • Edited

Oh neat! That'll be even nicer. :) Thanks!