Derivation is a linear operation, so
$$
\frac{\partial G}{\partial x_1}
= \frac{\partial}{\partial x_1}\int_0^{x_1}g_1(x,0)\,\mathrm dx
+ \frac{\partial}{\partial x_1}\int_0^{x_2}g_2(x_1,y)\,\mathrm dy
$$
The first term is the derivative of the integral (with respect to $x_1$), so you should know how to compute it. For the second term, you need to justify this:
$$ \frac{\partial}{\partial x_1}\int_0^{x_2}g_2(x_1,y)\,\mathrm dy
= \int_0^{x_2}\frac{\partial g_2}{\partial x_1}(x_1,y)\,\mathrm dy.
$$
There should be a theorem somewhere in your notes/books about that. Finally, just use the property $\partial g_2/\partial x_1=\partial g_1/\partial x_2$, and then the fundamental theorem of calculus should seal the deal.