Question

I've done a few pull requests on GH already, but I committed to the master branch. Now I read on various places that it's a good idea to create a branch.

Are there any guidelines for branch naming? I usually work with Mercurial and give my branches the same name as their relevant bug ticket ID, but that doesn't work for this.

I've looked at a few repositories: some commit to master, some commit to fix-somebug, some commit to patch-1. I understand that this doesn't create conflicts, because pull requests are merged to master (or a different, long living branch) and the branch is then deleted, is that correct?

Was it helpful?

Solution

The idea behind a branch for a pull request is to allow for said branch to be automatically deleted once the pull request is accepted.

And since April 2013, that branch will be deleted for you:

merge button

You are then suppose to update/rebase your master from the master of the upstream repo in order to get what you developed in isolation a branch from the official repo that you have forked (since that repo has accepted your pull request)

upstream

The name of the branch should represent the development effort you are engaged in.

OTHER TIPS

It is always a good practise to make commit on the git branches rather than master. You can use any name for your git branch(it doesn't allow spaces in branch names, also some special characters).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top