Nonlinear control-affine systems described by ordinary differential equations with time-varying vector fields are considered in the paper. We propose a unified control design scheme with oscillating inputs for solving the trajectory tracking and stabilization problems under the bracket-generating condition. This methodology is based on the approximation of a gradient-like dynamics by trajectories of the designed closed-loop system. As an intermediate outcome, we characterize the asymptotic behavior of solutions of the considered class of nonlinear control systems with oscillating inputs under rather general assumptions on the generating potential function. These results are applied to examples of nonholonomic trajectory tracking and obstacle avoidance.