๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๊ฐœ๋ฐœ์ƒํ™œ/Git8

git lfs ์˜ฌ๋ ธ๋˜ ๋ฐ์ดํ„ฐ ์‚ญ์ œ lfs๋กœ ์˜ฌ๋ ธ๋˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋”์ด์ƒ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„ ์‚ญ์ œํ•˜๊ณ  ์‹ถ์—ˆ๋‹ค.์ตœ์ข…์ ์œผ๋กœ ์›ํ–ˆ๋˜ ์•ก์…˜์€ ์ถ”์ ํŒŒ์ผ ์‚ญ์ œ, ์›๋ณธ ๋ฐ์ดํ„ฐ ๋กœ์ปฌ๋งŒ ์œ ์ง€, lfs ์ž์ฒด uninstall 1. lfs์— ์˜ฌ๋ผ๊ฐ„ ์ถ”์ ํŒŒ์ผ -> ์›๋ณธ ํŒŒ์ผ๋กœ ๋ณ€๊ฒฝgit lfs fetch --allgit lfs checkout 2. lfs ๋ฐ์ดํ„ฐ ์ถ”์  ์‚ญ์ œgit lfs untrack "src/main/resources/data.csv"git lfs untrack "src/test/resources/testData.csv" ์ด๋•Œ untrack๋งŒ ํ•˜๋ฉด ๊ณ„์† git lfs ls-files ํ• ๋•Œ ๋ณด์ด๋”๋ผGit ์บ์‹œ์™€ ์ธ๋ฑ์Šค๋„ ์ •๋ฆฌํ•ด์ค˜์•ผํ•œ๋‹ค๊ณ  ํ•จgit rm --cached "src/main/resources/data.csv"git rm --cached "src/t.. 2024. 11. 3.
github git-lfs ์‚ฌ์šฉ ๋Œ€์šฉ๋Ÿ‰ ํŒŒ์ผ ์—…๋กœ๋“œ ๊นƒํ—ˆ๋ธŒ ํŒŒ์ผ ์—…๋กœ๋“œ ์‹œ 25๋ฉ”๊ฐ€ ์šฉ๋Ÿ‰ ์ œํ•œ์ด ์žˆ์Œ git-lfs ์ด์šฉํ•ด์„œ ์—…๋ฐ์ดํŠธ ํ•„์š” ์ฃผ์˜ ์‚ฌํ•ญ์˜ฌ๋ฆฌ๋Š” ์‚ฌ๋žŒ๋„ ๋ฆฌํฌ๋ฅผ ํด๋ก  ๋ฐ›๋Š” ์‚ฌ๋žŒ๋„ ๋ชจ๋‘ git-lfs๊ฐ€ ์„ค์น˜ ๋˜์–ด์žˆ์–ด์•ผํ•จgit-lfs๊ฐ€ ์„ค์น˜๋˜์–ด์žˆ์ง€ ์•Š์€ PC์—์„œ lfs๋กœ ์—…๋กœ๋“œํ•œ ํŒŒ์ผ์„ ๋‹ค์šด๋ฐ›์œผ๋ฉด ํฌ์ธํ„ฐ๋งŒ ๋‹ค์šด๋ฐ›์•„์ง ์„ค์น˜ ๋ฐ ์—…๋กœ๋“œ ๋ฐฉ๋ฒ•1. ์„ค์น˜ : brew install git-lfs2. lfs ์ดˆ๊ธฐํ™” : git lfs install3. ํŒŒ์ผ ์ถ”์  ์„ค์ • : git lfs track "*.csv" ex)csvํŒŒ์ผ์„ ์ถ”์ ํ•˜๊ณ  ์‹ถ๋‹ค.4. ํŒŒ์ผ ์ถ”๊ฐ€ ๋ฐ ์ปค๋ฐ‹๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋กœ ์ด๋™git add .gitattributesgit add {์ด๋ฆ„}.csvgit commit -m "Add large CSV file using Git LFS"git push origin m.. 2024. 8. 15.
GitHub ๋ช…์‹ฌ! ๋งจ๋‚  ํ•˜๋„ ๊นŒ๋จธ๊ฑฐ์„œ github ์“ธ ๋•Œ ๋ช…์‹ฌํ•  ๊ฒƒ๋“ค ์ •๋ฆฌ 1. ๊ฐœ์ธ ํ”ผ์”จ๊ฐ€ ์•„๋‹ˆ๋ฉด ํ”„๋กœ์ ํŠธ ์„ค์ • ํ›„์— git ์ •๋ณด๋ฅผ ๋จผ์ € ๋ด๋ผ git config user.email / git config user.name 2. ๊ฐ„ํ˜น user.name ๋งž์ถฐ๋†จ๋Š”๋ฐ ์™œ push ์ด๋ ฅ์— github profile์ด ์•ˆ๋ณด์ด๊ณ  ์ž”๋””๊ฐ€ ์•ˆ์‹ฌ์–ด์ง€๋Š”๊ฐ€? email์„ ์˜์‹ฌํ•ด๋ผ email์„ ๋‹ค์‹œ ๋ฐ”๊ฟ”์ฃผ๋˜๊ฐ€ ์•„๋‹˜ ์ด๋ฉ”์ผ ์„ค์ •์—์„œ ์ถ”๊ฐ€ ๋ฉ”์ผ๋กœ ๋“ฑ๋ก์„ ํ•ด๋†”๋ผ ์ถ”๊ฐ€๋ฉ”์ผ ๋“ฑ๋กํ•˜๋ฉด ๋กœ๊ทธ์— ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๋Š” ์•ˆ๋ณด์—ฌ๋„ ์ž”๋””๋Š” ์‹ฌ์–ด์ง„๋‹ค 3. github access token์„ ์ž˜ ๊ฐ–๊ณ ์žˆ๊ณ  ๋ฐ›์•„๋‘ฌ๋ผ push ํ• ๋•Œ ์ธ์ฆ์ •๋ณด ์ž…๋ ฅ ์‹œ id pw๋ฅผ ์ง€์›์„ ์•ˆํ•œ๋‹ค ์ธ์ฆ์ •๋ณด ๋งž๊ฒŒ ์ž…๋ ฅํ–ˆ๋Š”๋ฐ๋„ pw๊ฐ€ ํ‹€๋ ธ๋‹ค๊ณ  ๋œฌ๋‹ค github setting ๋“ค์–ด๊ฐ€์„œ develope.. 2023. 12. 14.
github repository ํ•˜๋‚˜๋กœ ํ•ฉ์น˜๊ธฐ repoํ•˜๋‚˜์˜ ํ•˜์œ„์˜ ์—ฌ๋Ÿฌ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋†“๊ธฐ (๊ธฐ์กด ๊ฒƒ๋“ค ์˜ฎ๊ธฐ๊ธฐ) 1. github์—์„œ ์ƒˆ๋กœ์šด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์ƒ์„ฑ (์—ฌ๊ธฐ์— ๋ชจ์„ ๊ฒƒ์ด๋‹ค) ex ) archive 2. ์ƒˆ๋กœ ๋งŒ๋“  ๋ฆฌํฌ Local clone terminal์„ ํ•˜๋‚˜ ์—ด๊ณ , cloneํ•  ๊ฒฝ๋กœ๋กœ ์ด๋™ ๋‚˜์˜ ๊ฒฝ์šฐ ~/workspace/miyeon ํ•˜์œ„์— ์—ฌ๋Ÿฌ ๋ฆฌํฌ๋“ค์„ ๋ชจ์•„๋‘ . archive์—ญ์‹œ ์—ฌ๊ธฐ์— ์ƒ์„ฑํ•  ์˜ˆ์ • (๋”ฐ๋กœ archive๋ผ๋Š” ํŒจํ‚ค์ง€ ์•ˆ๋งŒ๋“ค์–ด๋„ ํด๋ก ํ•  ๋•Œ archive ํŒจํ‚ค์ง€ ์ƒ์„ฑํ•˜๋ฉด์„œ ํด๋ก ๋จ) git clone {{cloneUrl}} git init 3. ์ƒˆ ๋ฆฌํฌ์— commit ๋‚˜์˜ ๊ฒฝ์šฐ์—๋Š” readme๋ฅผ ๋งŒ๋“ค์–ด์„œ ์˜ฌ๋ ธ์Œ. (์ฃผ์˜, ๊ฐœ์ธPC๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€ ์•Š์•„ git config๊ฐ€ global config๋กœ ๋˜์–ด์žˆ์Œ. ์ฒดํฌ ํ›„ ์ปค๋ฐ‹ ์ „ ๋ณ€.. 2023. 8. 9.
Clone์œผ๋กœ ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐํ™” ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋งŒ๋“ค๊ณ  ์ƒˆ๋กœ ๊ตฌ์„ฑํ•ด์„œ ์˜ฌ๋ฆฌ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ์ง€๋งŒ, ๊ธฐ์กด ํ”„๋กœ์ ํŠธ๋ฅผ Clone ํ•˜์—ฌ, ๊ธฐ์กด Git ์—ฐ๊ฒฐ์„ ๋Š๊ณ  Commit๋“ค์„ ์ดˆ๊ธฐํ™” ํ•œ ํ›„ ํ•„์š” ํŒŒ์ผ๋“ค๋งŒ ์ถ”๋ ค์„œ ์ปค๋ฐ‹ ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ƒˆ๋กœ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•. Clone ๋œฌ ์›๊ฒฉ ๋ถ€ํ„ฐ ๋Š๊ธฐ git remote -v git remote remove origin ์›๊ฒฉ ์—ฐ๊ฒฐ ๋Š๊ณ  ๋‚œ ํ›„ Git ์ดˆ๊ธฐํ™” rm -rf .git git init ์ฒซ Commit ์ž‘์„ฑ git add . git commit -m "Initial Commit" ์›๊ฒฉ ์ €์žฅ์†Œ(Bitbucket, github ...)์— ์ƒˆ๋กœ์šด Repository ์ƒ์„ฑ git ์ €์žฅ์†Œ ์—ฐ๊ฒฐ ํ›„ ํ‘ธ์‰ฌ git remote add origin {remoteUrl} git push -u --force or.. 2022. 5. 28.
[GIT] Reset ๋ช…๋ น์–ด git reset –hard b1f78bc ๋‹ค ๋‚ ๋ ค๋ฒ„๋ฆผ git reset –soft b1f78bc ์ž‘์—… ์ด๋ ฅ ๋‹ค ๋ณด์กด ๋ฐ stage์— ๊ณ ๋Œ€๋กœ ์žˆ์Œ git reset –mixed b1f78bc (default) ์ž‘์—… ์ด๋ ฅ ๋ณด์กด์ด๋‚˜ ์ปค๋ฐ‹์„ ์œ„ํ•ด ๋‹ค์‹œ ์ง€์ •ํ•ด์•ผํ•จ git reset HEAD~1 : ํ˜„์žฌ๋ถ€ํ„ฐ 1๊ฐœ ์ „ 2022. 3. 29.
[GIT] Clone์œผ๋กœ ์‹ ๊ทœ ์ƒ์„ฑ ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐํ™” 1. Clone ๋œฌ ํ”Œ์  ์›๊ฒฉ ๋Š๊ธฐ git remote -v git remote remove origin 2. ์›๊ฒฉ ๋Š์–ด์ฃผ๊ณ  ๋‚œ ๋’ค rm -rf .git git init git add . git commit -m "initial commit" 3. BitBucket๊ฐ€์„œ ์ƒˆ๋กœ์šด Repository ์ƒ์„ฑ 4. Git ์ €์žฅ์†Œ ์—ฐ๊ฒฐ ํ›„ ๊ฐ•์ œ push git remote add origin {git remote url} git push -u --force origin master 2022. 3. 20.
๋กœ์ปฌ ํ”„๋กœ์ ํŠธ๋ฅผ GitHub Repository๋กœ ์ƒ์„ฑ & ์—ฐ๊ฒฐ ๋กœ์ปฌ์— ์ธํ…”๋ฆฌ์ œ์ด์—์„œ ์ƒˆ๋กœ ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ๊นƒํ—ˆ๋ธŒ์— ์˜ฌ๋ฆฐ๋‹ค. ํ„ฐ๋ฏธ๋„๊ณผ ํˆด ํ™œ์šฉํ•ด์„œ ์—…๋กœ๋“œ ์„ฑ๊ณตํ•œ ์ผ€์ด์Šค.. ์‚ฌ์ „ ์ž‘์—… ์ธํ…”๋ฆฌ์ œ์ด์™€ ๊นƒ ํ—™์ด ์—ฐ๊ฒฐ์ด ๋˜์–ด ์žˆ์–ด์•ผํ•จ (ํ•„์ˆ˜๋Š” ์•„๋‹ˆ๋‚˜ ํŽธํ•จ) ์ปค๋งจ๋“œ+, (setting) : github -> + -> ๋‚˜์˜ ๊นƒํ—™ ๊ณ„์ • ๋“ฑ๋ก (๋“ฑ๋ก ์‹œ ํ† ํฐ ์‚ฌ์šฉ ๊ถŒ์žฅ. ์—ฌ๊ธฐ์„œ ์„ค๋ช…ํ•˜๋Š” ๊ถŒํ•œ์ด ๋ชจ๋‘ ์žˆ๋Š” ํ† ํฐ์ด์–ด์•ผ๋งŒ ๋กœ๊ทธ์ธ ๊ฐ€๋Šฅ) ์ธํ…”๋ฆฌ์ œ์ด ๋กœ์ปฌ ํ”Œ์  ์ƒ์„ฑ ๋ฐ ๊ฐœ๋ฐœ ์ž‘์—… VCS -> Enable Version Control Integration Git ์„ ํƒ ์™„๋ฃŒ ์‹œ -> Created Git repository in /๊ฒฝ๋กœ/๊ฒฝ๋กœ/๊ฒฝ๋กœ/projectnm ๋ฉ”์„ธ์ง€ ํ•˜๋‹จ์— ํŒ์—… ๋œธ Git -> Github -> Share Project on Github ์ผ๋‹จ ์ด๋ ‡๊ฒŒ ํ–ˆ๋”๋‹ˆ ๊นƒํ—™์— ๋ฆฌํฌ ์ƒ.. 2022. 3. 2.