In Polchinski's string theory volume 1, at chap 1.2, after equation 1.2.22, he says $$\nabla_{a}T^{ab}=0$$ as a consequence of diffeomorphism invariance.
But I cannot derive it. My derivation is as follows:
Under the reparametrization:${\sigma^{a}}'=\sigma^a+\epsilon^a$ $$\delta X^\mu=X'^\mu(\tau',\sigma')-X^{\mu}(\tau',\sigma')=-\epsilon^a \partial_{a}X^\mu$$
$$\delta \gamma_{ab}=\gamma'_{a,b}(\tau',\sigma')-\gamma_{ab}(\tau ', \sigma')=-\nabla_{a}\epsilon_b-\nabla_b \epsilon_a$$ Since this is a symmetry, it leave the action invariant up to a total derivative. But in this case, if we choose $\epsilon=0$ at the boundary of the worldsheet, the action is invariant: $$\delta S=0$$
Thus we have: $$\delta S=\frac{\delta S}{\delta{\gamma_{ab}}}\delta \gamma_{ab}+\frac{\delta S}{\delta X^{\mu}}\delta X^{\mu}=0$$
By definition:
$$\frac{\delta S}{\delta \gamma_{ab}}=-\frac{1}{4\pi}(-\gamma)^{1/2}T^{ab}$$
Thus we have
$$\int d^2 \sigma (\frac{1}{4\pi}(-\gamma)^{1/2}T^{ab}(\nabla_a \epsilon_b+\nabla_b \epsilon_a)+\frac{\delta S}{\delta X^\mu}\delta X^\mu)=0$$
In order to have $\nabla_a T^{ab}=0$, we need to have $\frac{\delta S}{\delta X^\mu}=0$, which can be obtained by imposing the the equation of motion of $X^{\mu}$.There is no wrong in imposing the equation of motion to get conserved currents.
But my confusion is that if we have to impose the equation of motion of $X^\mu$ to get $\nabla_a T^{ab}=0$, why we can't use equation of $\gamma_{ab}$ ,namely $T_{ab}=0$ to get the conclusion. Why bother using eom of $X^{\mu}$?
I will appreciate that if someone can help check my argument to point out my mistake or explain the reason.