The binary offset carrier (BOC) modulation used in global navigation satellite system (GNSS) has better tracking accuracy and anti-interference ability. Nevertheless, the multiple side-peaks in the BOC autocorrelation put forward new requirements on the signal tracking ability of the receiver. In this study, we proposes a new technique that eliminates ambiguity in code tracking significantly. Based on sub cross-correlation shift, this method is applicable to BOC(kn,n) group signals. Furthermore, this technique can effectively remove the multimodality of the BOC signal and retain the narrow correlation peak. Taking BOC(1,1) and BOC(10,5) as examples, this method is compared with other algorithms. The experiments result shows that the proposed method has better performance in the main peak width, phase discrimination curve and anti-multipath performance.