-
Notifications
You must be signed in to change notification settings - Fork 0
Description
๐ฉโ๐ป Submodule ์์ ํ๋ก์ธ์ค
-
์์ ๋ธ๋์น ์์ฑ ๋ฐ ์์ ์์
git checkout -b feature/<your-feature-name>
-
์ฝ๋ ์์ ๋ฐ ์ปค๋ฐ
์์ ํ ์ฝ๋๋ฅผ ์ปค๋ฐํฉ๋๋ค:git add . git commit -m "feat: Add <your-feature-description>"
-
Remote
main๋ธ๋์น๋ก Merge
์์ ์ด ์๋ฃ๋๋ฉดmain๋ธ๋์น๋ก ์ด๋ํ์ฌ Mergeํฉ๋๋ค:git checkout main git merge feature/<your-feature-name> git push origin main
-
Submodule ์ํ ํ์ธ
๋ณ๊ฒฝ๋ Submodule ์ํ๋ฅผ ํ์ธํ๋ ค๋ฉด:git log --oneline
๐ Parent Repository์์ Submodule ๊ด๋ฆฌ ํ๋ก์ธ์ค
-
Submodule์ ์ต์ ์ํ ์ ๋ฐ์ดํธ
Parent Repository์develop๋ธ๋์น์์ Submodule์ ์ต์ ์ํ๋ก ์ ๋ฐ์ดํธํฉ๋๋ค:git submodule update --remote --merge
๐ Note: ์ด ๋ช ๋ น์ด๋
.gitmodules์ ์ค์ ๋ Submodule์main๋ธ๋์น๋ฅผ ๊ธฐ์ค์ผ๋ก ์ ๋ฐ์ดํธํฉ๋๋ค. -
Submodule ๋ณ๊ฒฝ์ฌํญ ์ปค๋ฐ
๋ณ๊ฒฝ๋ Submodule์ Parent Repository์ ๋ฐ์ํฉ๋๋ค:git add srcs/<submodule> git commit -m "chore: Update <submodule-name> to latest main" git push origin develop
-
Parent Repository์
developโmainMerge
์์ ์ด ์๋ฃ๋๋ฉด Parent Repository์main๋ธ๋์น๋ก Mergeํฉ๋๋ค:git checkout main git merge develop git push origin main
๐ ๏ธ ์ฐธ๊ณ ์ฌํญ ๋ฐ ์ฃผ์์ฌํญ
-
Submodule ์ํ ํ์ธ
- Submodule์ด ์ฌ๋ฐ๋ฅธ ์ปค๋ฐ์ ๊ฐ๋ฆฌํค๊ณ ์๋์ง ํ์ธํ๋ ค๋ฉด:
git submodule status
- Submodule์ด ์ฌ๋ฐ๋ฅธ ์ปค๋ฐ์ ๊ฐ๋ฆฌํค๊ณ ์๋์ง ํ์ธํ๋ ค๋ฉด:
-
Submodule ์ถฉ๋ ๋ฐ์ ์
- Submodule์์ ์ถฉ๋์ด ๋ฐ์ํ๋ฉด ํด๋น ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ์ฌ ์ง์ ํด๊ฒฐํฉ๋๋ค:
cd srcs/<submodule> git pull origin main
- Submodule์์ ์ถฉ๋์ด ๋ฐ์ํ๋ฉด ํด๋น ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ์ฌ ์ง์ ํด๊ฒฐํฉ๋๋ค:
-
Submodule ๋ธ๋์น
- ๋ชจ๋ Submodule์ ๋ฐ๋์
main๋ธ๋์น๋ฅผ ๊ธฐ์ค์ผ๋ก ์์ ํฉ๋๋ค. .gitmodules์ ์ค์ ๋ ๋ธ๋์น(branch = main)๋ฅผ ํ์ธํ์ธ์:[submodule "srcs/<submodule>"] path = srcs/<submodule> url = <submodule-url> branch = main
- ๋ชจ๋ Submodule์ ๋ฐ๋์
-
ํ์ ๊ฐ ์ปค๋ฎค๋์ผ์ด์
- Submodule ์์
์ Parent Repository๋ก ํตํฉํ๊ธฐ ์ , ์์
๋ธ๋์น๋ฅผ ๋ฐ๋์ Submodule์
main์ผ๋ก Mergeํ๊ณ Pushํ์ธ์.
- Submodule ์์
์ Parent Repository๋ก ํตํฉํ๊ธฐ ์ , ์์
๋ธ๋์น๋ฅผ ๋ฐ๋์ Submodule์
๐ ์ํฌํ๋ก์ฐ ์์ฝ
- ํ์: Submodule ์์
ํ
main๋ธ๋์น๋ก Merge ๋ฐ Push. - Parent Repository ๊ด๋ฆฌ์:
- Submodule ์ต์ ์ํ ์
๋ฐ์ดํธ (
git submodule update --remote --merge). - Submodule ๋ณ๊ฒฝ์ฌํญ ์ปค๋ฐ ๋ฐ Parent Repository
developโmainMerge.
- Submodule ์ต์ ์ํ ์
๋ฐ์ดํธ (