[Git] conflict ๐ฅ
![[Git] conflict ๐ฅ](https://cdn.hashnode.com/res/hashnode/image/unsplash/Iq9SaJezkOE/upload/v1659527052825/TS1iy7iFc.jpeg)
๐ Hi there! I'm Suzie, a developer who began my coding journey in 2023. Iโm passionate about building fast and dynamic web experiences using Next.js, JavaScript, and Tailwind CSS.
๐ฑ As I grow in tech, I enjoy documenting my learning journey and sharing insights to help others navigate their path.
โจ Fun fact: When Iโm not coding, you can find me practicing Capoeria ๐คธ.
Letโs connect, learn, and create together!
์ฒ์์ผ๋ก team project๋ ์ด๋ป๊ฒ ๊ด๋ฆฌ๋๋์ง ๋ฐฐ์ธ ์ ์๋ ๋ ์ด์๋ค. ๊ทธ ์ค์ conflict๋ ๋ฌด์์ด๊ณ ์ด๋ป๊ฒ ํ๋์ง ์๊ฒ ๋์๋๋ฐ ์์ด๋ฒ๋ฆฌ๊ณ ์ถ์ง ์์์ ๋ธ๋ก๊ทธ์ ์์ฑํ๋ค.
๊ฐ๋
- branch์ branch์ merge๊ณผ์ ์์, ๋์ผํ ๋ด์ฉ์ ๊ฐ์ ๋ค๋ฅด๊ฒ ๋ณ๊ฒฝํ ์ด๋ ฅ์ด ์์ ๋ ๋ณ๊ฒฝ ์ด๋ ฅ๋ค๋ผ๋ฆฌ ๋ฐ์ํ๋ ์ถฉ๋
๋ฐ์๊ณผ์
- feature A๊ฐ ์์
์๋ฃ(Hello Dog) ๋ค, github์ผ๋ก
git push origin feature/A->pull request->merge feature B๋ ์์ ์๋ฃ(Hello Cat) ๋ค, github์ผ๋ก
git push origin feature/B->pull request-> ๐ฅ conflict ๋ฐ์!local์ master๋ ์์ง ์ ๋ฐ์ดํธ ๋์ด์์ง ์๋ ์ํฉ์ด๋ผ github์ ์๋ master์ ๋ง์ถฐ ์ค ํ, conflict๋ฅผ ํด๊ฒฐํด์ผํจ
3๋ฒ์ ์ํด์ ๋ก์ปฌ์์ ์์ branch๋ฅผ main์ผ๋ก ๋ฐ๊พผ ํ(
git checkout main) main์ local๋ก pull ํ๊ณ (git pull origin main) ์ฐ๋ฆฌ๊ฐ ๋ณ๊ฒฝํด ์ฃผ๊ณ ์ถ์ feature B๋ก ๋ค์ branch๋ฅผ ๋ณ๊ฒฝ(git checkout feature/B) ๊ทธ๋ค์ ๋ง์คํฐ์ ์๋ ์์ ๋ด์ญ์ B์๊ฒ ํฉ์ณ์ผ ํจ(git merge main)
์ ๋ฆฌํ๋ฉด
git checkout main
โฌ๏ธ
git pull origin main
โฌ๏ธ
git checkout feature/B
โฌ๏ธ
git merge main
Conflict ํด๊ฒฐ(์ฝ๋ ์์ )
add -> commit -> push
ํด๊ฒฐ๋ฐฉ๋ฒ
<<< (current change)
=== (๊ตฌ๋ถ์ )
>>> (incoming change)
- conflict๊ฐ ์๋ ๋ถ๋ถ์ ์์ ๊ฐ์ด ํ์ํด ์ฃผ๋๋ฐ ์ ํ์๋ค์ ๋ค ์ ๊ฑฐํ ๋ค, ์ํ๋ ์ต์ข ํํ๋ก ๋ง๋ค๊ณ SAVE.
์๊พธ save๋ฅผ ๊น๋จน๊ณ git add commit push๋ฅผ ์งํํด ์ฃผ์ด ์๋ฌด๊ฒ๋ ๋ณํ์ง ์์ ํผ๋์ค๋ฌ์ ๋ค. ์ ์ฅํ๋๊ฒ์ ๊ผญ ๊ธฐ์ตํ์!

![[TypeScript] Understanding Generic Functions](https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/NH0pmKaZeuk/upload/47eb76a03d44ea841c42f406a93de157.jpeg)
