Electromagnetic formation flying is a novel concept of controlling the relative degrees of freedom of a satellite formation without the expenditure of fuel by using high temperature superconducting wires to create magnetic electromagnetic formation flying Because of inherent nonlinearities and couplings, the dynamics and control problem associated with electromagnetic formation flying are difficult, especially for near Earth operations This paper presents the application of nonlinear adaptive control laws that enable formation maintenance and reconfiguration An approach to control allocation as the solution of an optimization problem is also proposed The accumulation of angular momentum in the presence of Earth's magnetic field is an issue with electromagnetic formation flying and ways of managing it by exploiting the nonlinearity of magnetic dipoles using polarity switching are presented as a solution Closed loop nonlinear simulation results are also presented to demonstrate the feasibility and importance of the control scheme described for electromagnetic formation flying for near Earth operations