The eta-invariant of an odd dimensional manifold with boundary is inve
stigated. The natural boundary condition for this problem requires a t
rivialization of the kernel of the Dirac operator on the boundary. The
dependence of the eta-invariant on this trivialization is best encode
d by the statement that the exponential of the eta-invariant lives in
the determinant line of the boundary. Our main results are a variation
al formula and a gluing law for this invariant. These results are appl
ied to reprove the formula for the holonomy of the natural connection
oh the determinant line bundle of a family of Dirac operators, also kn
own as the ''global anomaly formula.'' The ideas developed here fit na
turally with recent work in topological quantum field theory, in which
gluing (which is a characteristic formal property of the path integra
l and the classical action) is used to compute global invariants on cl
osed manifolds from local invariants on manifolds with boundary.