๐คทโ๏ธ ์๋ฌ ์ํฉ
- ์๊ฒฉ ์๋ฒ์์ ๋ธ๋์น ๋ณ๊ฒฝ์ ํ๋ ค๊ณ checkout ๋ช ๋ น์ด๋ฅผ ์ผ๋๋ฐ ์ด๋ฐ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด์ ๋ธ๋์น ์ ํ์ด ์ ๋จ
error: Your local changes to the following files would be overwritten by checkout:
src/main/resources/application.properties
Please, commit your changes or stash them before you can switch branches.
error: The following untracked working tree files would be overwritten by checkout:
src/main/resources/application-prod.properties
Please move or remove them before you can switch branches.
โ ๋ฐ์ ์์ธ
- ํ์ฌ ๋ธ๋์น์์ ๋ณ๊ฒฝ์ฌํญ์ด ์๋๋ฐ ์ปค๋ฐ์ ํ์ง ์๊ณ ๋ธ๋์น ์ ํ์ ํ๋ ค๊ณ ํด์ ๋ฐ์ํ ์ค๋ฅ
โกํด๊ฒฐ ๋ฐฉ๋ฒ
- ํด๋น ๋ธ๋์น๋ฅผ ์ปค๋ฐํจ
1. `git commit -m "message"`
2. `git checkout <์ ํํ branch>`
- ์ปค๋ฐ์ ์ํ์ง ์์ ๊ฒฝ์ฐ ๋ณ๊ฒฝ ์ฌํญ์ ์์ ์ ์ฅํจ
1. `git stash` : ํ์ผ ๋ด ๋ณ๋์ฌํญ์ ์คํ์ ๋ฃ์ด๋
2. `git checkout <์ ํํ branch>`
3. `git checkout <๊ธฐ์กด์ ์์ ํ๋ branch>`
4. `git stash pop` : ์คํ์ ์ ์ฅํ ๋ณ๋์ฌํญ์ ๋ค์ ๊ธฐ์กด ๋ธ๋์น๋ก ๊ฐ์ ธ์ค๊ณ , ์คํ ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํจ