This paper develops a trajectory planning for a space robot, which enables us to simultaneously control its base attitude as well as the end effector trajectory. First, it is shown how the space robot dynamics can be formulated in the context of regular Lagrangian systems with holonomic constraints. Second, geometry of the space robot motion is explored; namely, it is shown how geometric phases corresponding to deviations of the base attitude are yielded in conjunction with the end effector motion. In our trajectory planning, it is demonstrated how the base attitude of the space robot can be controlled by the end effector in iteratively drawing complementary circles to reduce the geometric phase. Finally, we demonstrate the validity of our approach with numerical simulations.