Keep in mind that S is a variable of G and S is the only variable of G.
So here differentiation of G is only with respect to S, no time t at all. Time t is not a ( directly ) variable of G at all. This logic is the same as the ordinary differentiation. Hope this is clear to you.