์์ฑ ๋๊ธฐ
Spring Server ํ๋ก์ ํธ์์ ๋ฏผ๊ฐํ ์ ๋ณด(RDS id, pw ๋ฑ)๋ฅผ ์จ๊ธฐ๊ธฐ์ํด ์์๋ณด๋ ์ค ์จ๊ธธ ํ์ผ์ ๊น๋นกํ๊ณ commit ํด๋ฒ๋ ค์ ๋ค๋ฆ๊ฒ .gitignore ์ ์ถ๊ฐํ์ง๋ง ์๊ฐํ๋๋ก untrack file๋ก ๋ถ๋ฅ๋์ง ์์๊ณ ๊ฐ์ ์ผ์ ๊ฒช๋ ๋ถ๋ค์ ์ํด ํด๊ฒฐ ๊ณผ์ ์ ์์ฑํ๊ฒ ๋์๋ค.
(์ฐธ๊ณ )[๋ฏผ๊ฐ ์ ๋ณด ์จ๊ธฐ๊ธฐ Notion ์ ๋ฆฌ]
https://sin-young.notion.site/Spring-yml-3dbd8f027c854995bb098931737469af
[Spring] *.yml ๋ฑ ๋ฏผ๊ฐ ์ ๋ณด ์จ๊ธฐ๊ธฐ
์๋ฒ ํ์ผ์ ์คํ์์ค์ ๊ณต๊ฐ๋ก ์ ๋ก๋์ .yml ๋๋ .properties ๋ด๋ถ ๋ฏผ๊ฐ ์ ๋ณด(๋น๋ฐ๋ฒํธ, ์์ด๋ ๋ฑ)๋ฅผ ์จ๊ธธ ํ์์ฑ์ ๋๊ปด์ ์ ๋ฆฌํ๊ฒ ๋์๋ค.
sin-young.notion.site
ํด๊ฒฐํ๊ธฐ
์ด๋ฏธ commit ํด๋ฒ๋ฆฐ ํ์ผ์ ๋ํด gitignore์ ์ ๋ ฅํ๋ค๊ณ ํด๋ ๊ณ์ trackํ๊ธฐ ๋๋ฌธ์ cache๋ฅผ ์ง์ธ ํ์๊ฐ ์๋ค.
1. cache ์ง์ฐ๊ธฐ : --cached ์ต์ ์ ํ์ฌ track ์ค์ธ ํ์ผ๋ค์ ๋ํ๋ธ๋ค.
2. cache๋ฅผ ์ง์ฐ๊ณ ์ .gitignore์ untrackํ ํ์ผ ์์ฑ๋์๋์ง ํ์ธ
3. add ๋ฐ commit ์งํ
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
.Gitignore Tip
ํ๋ก์ ํธ๋ฅผ github์ ๊ด๋ฆฌํ๋ค๋ณด๋ฉด .gitignore์ ์ ๊ฒฝ์จ์ผํ๋ค.
๋งค๋ฒ ํ๋ก์ ํธ๋ง๋ค ์ ์ธํด์ผํ๋ ํ์ผ์ ์ผ์ผ์ด ์์ฑํ๋ ๊ฒ์ ๋ถํธํ๋ฐ, ์ด๋ฅผ ํด๊ฒฐํด์ฃผ๋ ๊ณ ๋ง์ด ์ฌ์ดํธ๊ฐ ์๋ค!
์๋ ์ฌ์ดํธ์ ๋ณธ์ธ ํ๋ก์ ํธ์์ ์ฌ์ฉํ๋ ๊ธฐ์ ์คํ์ ์์ฑํ์ฌ( ex Django, Spring, JAVA, Python ....) ์๋์ผ๋ก ์์ฑ๋ ํ ์คํธ๋ฅผ ๋ณต์ฌํ์ฌ ๋ณธ์ธ์ ํ๋ก์ ํธ gitignore์ ์ ๋ ฅํ๋ฉด ์ฝ๊ฒ ๊ด๋ฆฌํ ์ ์๋ค!
https://www.toptal.com/developers/gitignore
gitignore.io
Create useful .gitignore files for your project
www.toptal.com
REFERENCE
https://nan-sso-gong.tistory.com/38
[Git] repository์์๋ง ํน์ ํ์ผ ์ญ์ (.gitignore ์ฌ์ฉ)
1. ๋ฌธ์ git์ ์ฌ์ฉํ๋ค๋ณด๋ฉด ๊ฐ๋ฐํด๋ ๋ด์ ์๋ ํ์ผ์ด์ง๋ง ๊ณต๊ฐ์ ์ธ ์ฝ๋์ ์ฅ์์ ์ฌ๋ฆฌ๊ณ ์ถ์ง ์์ ํ์ผ์ด ์๋ค. ์๋ฅผ ๋ค์๋ฉด, /upload ํด๋์ ๋ด์ฉ์ด๋ผ๋๊ฐ ๊ฐ๋ฐ์ ํ์ํ API์ฝ๋๊ฐ ๋ค์ด๊ฐ ํ
nan-sso-gong.tistory.com
'๐Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[GIT] git pull error : invalid path | invalid argument (0) | 2023.05.20 |
---|