The problem of the magnetic attitude tracking control is studied for a gravity gradient microsatellite in orbital transfer. The contributions of the work are mainly shown in two aspects: (1) the design of an expected attitude trajectory; (2) a method of the magnetic attitude tracking control. In orbital transfer, the gravity gradient microsatellite under a constant thrust shows complicated dynamic behaviours. In order to damp out the pendular motion, the gravity gradient microsatellite is subject to the the attitude tracking problem. An expected attitude trajectory is designed based on dynamic characteristics revealed in the paper, which not only ensures the flight safety of the system, but also reduces the energy consumption of the controller. Besides, the control torque produced by a magnetorquer is constrained to lie in a two-dimensional plane orthogonal to the magnetic field, so an auxiliary compensator is proposed to improve the control performance, which is different from existing magnetic control methods. In addition, a sliding mode control based on the compensator is presented, and the Lyapunov stability analysis is performed to show the global convergence of the tracking error. Finally, a numerical case of the gravity gradient microsatellite is studied to demonstrate the effectiveness of the proposed tracking control.