On the other hand, we don't get a genealogy from Luke until Luke 3. The genealogy stands apart from the birth narrative and is embedded with the Synoptic material.
Matthew 1:
1 This is the genealogy of Jesus the Messiah the son of David, the son of Abraham:
2 Abraham was the father of Isaac,
...
16 and Jacob the father of Joseph, the husband of Mary, and Mary was the mother of Jesus who is called the Messiah.
There are other substantial differences as well. Luke's genealogy of course goes in reverse order, tracing back to Adam, who is called the son of God. Matthew's starts with Abraham.Luke 3:
23 Now Jesus himself was about thirty years old when he began his ministry. He was the son, so it was thought, of Joseph,
the son of Heli, 24 the son of Matthat,
...
38 the son of Seth, the son of Adam,
the son of God.
Matthew's associates Jesus with Mary. Luke's makes no mention of Mary. Luke's genealogy is mysterious, Jesus was "thought to be" the son of Joseph. Luke's is very bizarre, in that it implies that Jesus isn't actually the son of Joseph, but then lists out Joseph's genealogy anyway. While Luke's genealogy makes Joseph a descendant of David, it isn't called out. I'd say that Luke's appears more primitive. The genealogy of Matthew is far more well thought-out and integrated with the overall narrative.
My hypothesis is that Luke's genealogy came first, but Matthew's birth narrative came first. This implies that Luke 3 came before Matthew, which I think so. I think this makes a lot of sense developmentally. In Luke 3-23 we have a very rudimentary origin story for Jesus, that ties him to David, but its not entirely well developed. Then later Matthew comes along, takes the idea from proto-Luke, and develops a fully baked birth story. Then canonical Luke comes along and uses Matthew to develop a similar birth narrative that is prepended to the front of proto-Luke. At that point, canonical-Luke also does some editing of the main body of proto-Luke in light of Matthew, adding Matthean revisions on top of the original Lukan material.
Another interesting thing is that Luke 3:1 calls John the Baptist, "John son of Zechariah" instead of John the Baptist, but the name "John the Baptist" is used in Luke 7 & 9, without ever really having introduced the use of the title.