while writing a shell script, I need to git checkout to a branch after cd to a directory.< H2 > excuse me < / H2 >
however, in some cases, git checkout fails because the artificial modification file is not submitted.
should I judge that the execution of git checkout failed?
< H2 > current idea, but it seems to have no effect < / H2 >if (cd abc/ && git checkout master); then
echo "ok"
else
echo "fail"
fi