Cycle-slip causes discontinuous integer cycle jumps in phase measurements, detecting and correcting cycle-slip is an important issue for GNSS relative positioning. In this paper, a novel method is proposed to deal with the problem based on empirical mode decomposition (EMD) method. The proposed method consists of three steps. Firstly, a time differentiated GNSS phase signal is decomposed into a trend signal and a finite number of intrinsic mode functions (IMFs) by EMD. Secondly, a "cycle-slip signal" is obtained by removing the trend signal and low frequency IMFs from the original signal. Finally, an edge detection operator is applied on the "cycle-slip signal" to detect and repair the cycle-slip. Experiments verified the success rate of the algorithm up to 100 % (15° mask angle) in various simulated scenarios. Several tests were performed based on real data over multiple days, and the results confirm that the proposed algorithm is applicable for relative positioning.