Our teacher, the Rema, wrote that they should not practice in one city part of this custom and part of that custom, because of "do not cut yourselves." And all the more so one should not practice the leniency of both of them. Thus far his words. For one should not seize the leniency of this custom to permit until Rosh Chodesh Iyar, and the leniency of that one to permit from Lag BaOmer and onward, as this would be two contradictory positions. And it appears to me regarding his intention that even though at the end of the first chapter of Yevamot we say that regarding two beit dins in one city "do not cut yourselves" does not apply, and such is the conclusion of the Shas there according to Rava; and it is true that the Rambam, of blessed memory, at the end of the Laws of Idolatry ruled that there is "do not cut yourselves" in this case like Abaye there in Yevamot, but they have already wondered at his words for ruling like Abaye and not like Rava; however, we have reconciled his words in Yoreh Deah at the end of siman 180, see there. And this is the matter: for Rava rejected Abaye's view, that in matters of rulings of forbidden and permitted one does not need the verse of "do not cut yourselves," for from the verse of "follow the majority" we know that one must rule according to the opinion of the many. And if so, according to Rava, why is the verse of "do not cut yourselves" needed for one beit din in one city? Rather, Rava truly came to reject Abaye's view, and thus he rejected it: that in matters of rulings one does not need "do not cut yourselves," for regarding two beit dins in one city "do not cut yourselves" does not apply, and regarding one beit din we know it from the verse of "follow the majority." Rather, the essence of the verse of "do not cut yourselves" is regarding general customs, and in this it is forbidden even in two beit dins in one city. For in this, beit dins are not relevant, for granted that in a ruling the matter is not handed over to the masses, but in a general custom where these do thus and those do thus, even if the matter emerged from two beit dins—nevertheless the matter is unseemly, that it should appear that Israel in one city are divided into factions. And these are the very words of our teacher, the Rema, that they should not practice in one city part of this custom and part of another custom, even when the matter emerges from two beit dins. And this is also the intention of the Rambam, as I wrote there. And the minority is drawn after the majority (Magen Avraham, see there).
וכתב רבינו הרמ"א שלא ינהגו בעיר אחת מקצת מנהג זה ומקצת מנהג זה, משום "לא תתגודדו". וכל שכן שאין לנהוג היתר בשתיהן. עד כאן לשונו. דאין לתפוס קולתו של מנהג זה להתיר עד ראש חודש אייר, וקולתו של זה להתיר מל"ג בעומר ואילך, דהוה תרתי דסתרי. ויראה לי בכוונתו דאף על גב דבסוף פרק קמא דיבמות אמרינן דבשני בתי דינים בעיר אחת לא שייך "לא תתגודדו", וכן הוא מסקנת הש"ס שם אליבא דרבא; והן אמת דהרמב"ם ז"ל סוף הלכות עבודת כוכבים פסק דיש בזה "לא תתגודדו" כאביי שם ביבמות, אך כבר תמהו על דבריו שפסק כאביי ולא כרבא; אמנם אנחנו תרצנו דבריו ביורה דעה סוף סימן קפ, עיין שם. וכך הוא העניין: דרבא דחי לה לדאביי, דבענייני הוראות איסור והיתר אינו צריך קרא ד"לא תתגודדו", דמקרא ד"אחרי רבים להטות" ידענו שצריך לפסוק כפי דעת רבים. ואם כן לרבא על בית דין אחד בעיר אחד למה צריך קרא ד"לא תתגודדו"? אלא דרבא בא באמת לדחויי לדאביי, וכך דחי ליה דבענייני הוראות אינו צריך "לא תתגודדו", דבשני בתי דינים בעיר אחת לא שייך "לא תתגודדו", ובית דין אחד ידענו מקרא ד"אחרי רבים להטות". אלא עיקר קרא ד"לא תתגודדו" – הוא לעניין מנהגות בעלמא, וזהו אפילו בשני בתי דינין אסור בעיר אחת. דבזה לא שייך בתי דינים, דבשלמא בהוראה אין הדבר נמסר בידי ההמון, אבל במנהגא בעלמא שאלו יעשו כך ואלו יעשו כך, אף שהדבר יצא משני בתי דינין – מכל מקום מכוער הדבר שיראו שישראל בעיר אחת נפלגו לפלגות. והן הן דברי רבינו הרמ"א שלא ינהגו בעיר אחת מקצת מנהג זה ומקצת מנהג אחר, אפילו כשהדבר יוצא משני בתי דינין. וזהו גם כוונת הרמב"ם, כמו שכתבתי שם. והמיעוט נגרר אחר הרוב (מגן אברהם עיין שם).