3

I created a branch "newbranch" from the master, and then pushed back to the origin. I then created a pull request which was accepted and merged into master.

At this point should I delete "newbranch" from my local and re pull from master to begin working on something new?

What is the proper flow, after a branch has been accepted to master?

FluxEngine
  • 12,730
  • 14
  • 57
  • 83

2 Answers2

4

Update April 2013:

See "Redesigned merge button" and "What do you do with your branch after a pull request on GitHub?":

The branch is now deleted for you

new merge button


Original answer (February 2013)

The blog post "Tidying up after Pull Requests" is even more explicit:

The only trouble is that we end up with a lot of defunct branches after Pull Requests have been merged or closed.
From time to time, one of us would clear out these branches with a script, but we thought it would be better to take care of this step as part of our regular workflow on GitHub.com.

Starting today, after a Pull Request has been merged, you’ll see a button to delete the lingering branch:

enter image description here

The only case when you wouldn't want to delete that branch is:

  • if you intent to expend on your current patch, reusing the same branch
  • or you have started a few commit that hasn't been merged/accepted, and that would be lost if you deleted the branch:

If the Pull Request was closed without being merged, the button will look a little different to warn you about deleting unmerged commits:

enter image description here

That would avoid any accident, deleting a branch too soon.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

When it is merged into master, you can safely delete it.

KingCrunch
  • 128,817
  • 21
  • 151
  • 173