[Github/Git] There isn’t anything to compare. main and branch are entirely different commit histories. / fatal: refusing to merge unrelated histories ํด๊ฒฐ๋ฐฉ๋ฒ
GIT์ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ ๋ฆฝ์ ์ธ ํ์คํ ๋ฆฌ๋ฅผ ๋ณํฉํ์ง ์๋๋ค.
๋ฌธ์ ์ํฉ
์์คํ ํ๋ก๊ทธ๋๋ฐ ์ค์ต์์, ํ ํ๋ก์ ํธ๋ฅผ ํ๋ฉฐ 4๊ฐ์ ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด๋ฅผ ์ฌ์ฉํ๋ค.
ํ์๋ค์ ๊ฐ์ ํ๋์ ํ์ด์ ๋์ํ๋ ๋ธ๋์น๋ฅผ ์์ฑํด ๋ ๋ฆฝ์ ์ผ๋ก ์์ ์ ์งํํ๋ค.
๋ฌธ์ ๋ ์ต์ข ์ฝ๋๋ฅผ ์ ์ถํ๊ธฐ ์ํด ๊ฐ ๋ธ๋์น๋ฅผ main ๋ธ๋์น๋ก ๋ณํฉํ๋ ๊ณผ์ ์์ ๋ฐ์ํ๋ค.
๊นํ๋ธ์์ ์๋์ ๊ฐ์ ๋ฉ์์ง๊ฐ ์ถ๋ ฅ๋๋ฉฐ PR ์์ฑ์ด ๋ถ๊ฐ๋ฅํ๋ค.
There isn't anything to compare.
main and rfid-and-pir are entirely different commit histories
PR์ด ์์ ์ฌ๋ผ๊ฐ์ง ์๋ ์ํฉ์ด์๊ณ , ๊นํ๋ธ ์น ์ธํฐํ์ด์ค๋ง์ผ๋ก๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์๋ค.
๋ก์ปฌ ํ๊ฒฝ์์ CLI(Command Line Interface)๋ก ๊ฐ๋จํ ํด๊ฒฐํ ์ ์์๋ค.
์์ธ ๋ถ์
๋ฌธ์ ์ ์์ธ์ ๋ ๋ธ๋์น์ ์ปค๋ฐ ํ์คํ ๋ฆฌ๊ฐ ์์ ํ ๋ ๋ฆฝ์ ์ด๋ผ๋ ์ ์ด์๋ค.
GIT์ ๊ธฐ๋ณธ์ ์ผ๋ก "ํ์คํ ๋ฆฌ๊ฐ ์ฐ๊ฒฐ๋ ๋ธ๋์น"๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ณํฉ์ ์ํํ๋ค.
๊ทธ๋ฌ๋ ํ์คํ ๋ฆฌ๊ฐ ์์ ํ ๋ถ๋ฆฌ๋ ๋ ๋ธ๋์น๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ณํฉ์ด ํ์ฉ๋์ง ์๋๋ค.
๋ก์ปฌ ํ๊ฒฝ์์ git merge main์ ํตํด ๋ณํฉ์ ์๋ํด๋ ์๋์ ๊ฐ์ ๋ฉ์์ง๊ฐ ๋ํ๋๋ค.
fatal: refusing to merge unrelated histories
์ด ๋ฉ์์ง๋ ๋ ๋ธ๋์น ๊ฐ์ ๊ณตํต ์กฐ์์ด ์์์ ์๋ฏธํ๋ค.
์ฆ, ๋ ๋ธ๋์น๊ฐ ์๋ก ์์ ํ ๋ค๋ฅธ ํ์คํ ๋ฆฌ๋ก๋ถํฐ ์์๋์๊ธฐ ๋๋ฌธ์ ๊น์ ์ด๋ฅผ ๋ณํฉํ๋ ค ํ์ง ์๋๋ค.
ํด๊ฒฐ ๋ฐฉ๋ฒ
ํด๊ฒฐ๋ฐฉ๋ฒ: git merge main --allow-unrelated-histories
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์๋ --allow-unrelated-histories ์ต์ ์ ์ฌ์ฉํด ๊ฐ์ ๋ก ๋ณํฉ์ ํ์ฉํด์ผ ํ๋ค.
๋ณํฉ์ ํ๊ณ ๋ณ๊ฒฝ ์ฌํญ์ ์๊ฒฉ ์ ์ฅ์์ push ํ์ฌ ๊ฐ๋จํ ํด๊ฒฐํ ์ ์์๋ค.