Q:

How to get 'test' branch into 'master' when 'test' is a branch of 'dev'?

Looking at the network graph for a github project, I see 3 branches of interest; master, test, dev.
Looking at the github network graph further, I am led to believe that test is a branch of dev instead of a branch from master.
At some point, I will want to put the contents of test into master. 
Will I need to delete master and create a new branch called master from test in order to "get" test into master? By the way, I would like to keep the master history so I can roll back to an earlier commit if needed. So, deleting sounds bad.

A:

You should just merge test into master then.
$ git checkout master
$ git merge test

A statement like "test is a branch of dev instead of a branch of master" isn't really true wit Git. test might have branched off of commits from dev, but assuming that dev branched off of master at some point, then by the transitive property test branched off of master too.

