1

I'm relatively new on git, so keep that in mind.

So, I have three branches:

  • master
  • b1
  • b2

This is how my local and remote repository look like.

At one point, I merged b2 in to the master, and deleted b2 (all of this on my local repository). Lastly, I pushed my master to my origin/master.

My questions are:

  1. Now I want to delete b2 from the remote repo. How do I do that?
  2. Is this generally proper practice?

thanks

Metalzero2
  • 531
  • 2
  • 6
  • 17
  • 1
    Possible duplicate of [How do I delete a Git branch both locally and remotely?](https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-remotely) – Oliver Charlesworth Dec 27 '17 at 13:08

1 Answers1

0

1) Since your version of git is unknown, this will work:

Deleting local branch

$ git branch -d branch_name 

Deleting remote branch

$ git push -d <remote> <branch_name>

For recent versions there is a --delete flag, check this answer

2) If you are working in a team you can either let the remote branches be there and do a cleanup of merged branches from time to time or if that is not needed then IMO just to as you are doing.

Avoid leaving lost branches polluting your remote as you can always go back to a specific commit, no need to keep the old branches.

Silver
  • 693
  • 1
  • 10
  • 27