We carry the index theory for manifolds with boundary of Bär and Ballmann over to first order differential operators on metric graphs. This results in an elegant proof for the index of such operators. Then the self-adjoint extensions and the spectrum of the Dirac operator on the complex line bundle are studied. We also introduce two types of boundary conditions for the Dirac operator, whose spectrum encodes information of the underlying topology of the graph.