Linearity/“Well-definedness” of Differential and Shape Operators.

I'm currently working on a self study of Differential Geometry and have hit a snag in the study of differential maps.

The text that I am using defines the differential as follows:

Let $M_1$ and $M_2$ be regular embedded surfaces in $\mathbb{R}^3$ and $f:M_1 \to M_2$ be a smooth map. Then for every $p \in M_1$, we define a mapping $df_p:T_pM_1 \to T_{f(p)}M_2$ (the tangent spaces at $p$, $f(p)$) as follows: Let $v$ be in $T_pM_1$, and let $\gamma_v:(-\epsilon, \epsilon) \to M_1$ be a curve such that $\gamma_v(0)=p$ and $\gamma'_v(0)=v$. Then we set $df_p:=(f \circ \gamma_v)'(0)$.

Then it leaves to the reader to show that $df_p$ is well defined (independent of the smooth linear extension) and linear, and gives the following hint:

Let $g$ be a smooth extension of $f$ to an open neighborhood of $M$. Then $dg_p$ is well defined. Show that for all $v\in T_pM$, $df_p(v)=dg_p(v)$.

I'm really not sure what to make of the given hint or even how to approach this, so I'd be really appreciative of any help or guidance. Thanks.

-