Suppose that $Y/k$ is a an algebraic variety over a field $k$ of characteristic zero and
that $Y\subseteq X$ is a closed embedding into a smooth variety over $k$. Then the completion
of the de Rham complex of $X/k$ along $Y$ is independent (up to quasi-isomorphism) of $X$.
This is proven in Hartshorne's paper on de Rham cohomology. I want to understand the analogous statement for *maps*: suppose that $f:Y'\to Y$ is a morphism and that we can find smooth embeddings $Y'\subseteq X'$, $Y\subseteq X$ and maps $g_1,g_2 : X'\to X$ lifting $f$. Then they induce two maps of abelian sheaves on $Y'$:
$$
g_1^*, g_2^* : f^{-1}\hat{\Omega^*_X} \to \hat{\Omega^{*}_{X'}}
$$
(hats mean completion along $Y'$, resp. $Y$). These two maps should be homotopic. I can't quite see this. Any ideas? I would like to write down the homotopy explicitly if possible as well...

I don't think they are homotopic in general. If I remember correctly, the argument of independence is as follows: consider $p_1, p_2 : X\times X\to X$. Then maps $g_1, g_2 : X'\to X$ induce a map $g : X'\to X\times X$. Since $g = (f, f)$ when restricted to $Y'$, $g$ induces a map $g^* : \hat{\Omega^{*}_{X\times X}}\to \hat{\Omega^{*}_{X'}}$, where the first hat means completion with respect to $Y$ embedded diagonally in $X\times X$. Hartshorne results (the one you quoted) says that $p_1^*, p_2^* : \hat{\Omega^{*}_{X}}\to\hat{\Omega^{*}_{X\times X}}$ (again completed with respect to $Y$) are quasi-isomorphisms. Since $g_1 = p_1g$ and $g_2=p_2 g$, we see that on the derived category the maps $g_1^*$ and $g_2^*$ are isomorphic (meaning that there is a commutative square having $g_1^*$, $g_2^*$ on the left and right and having isomorphisms on the top and bottom. Moreover this square is ''functorial'' (i.e., if you have another lift, there is a cocycle condition). I hope the answer is clear; unfortunately it is hard to draw a diagram here...