๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ์ƒํ™œ/Git

Clone์œผ๋กœ ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐํ™”

by cocococo331 2022. 5. 28.

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋งŒ๋“ค๊ณ  ์ƒˆ๋กœ ๊ตฌ์„ฑํ•ด์„œ ์˜ฌ๋ฆฌ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ์ง€๋งŒ,

๊ธฐ์กด ํ”„๋กœ์ ํŠธ๋ฅผ 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 origin master

-u ์˜ต์…˜ : ๋‹ด ๋ถ€ํ„ฐ๋Š” git push๋งŒ ํ•ด๋„ origin master์— ์ž๋™ ํ‘ธ์‰ฌ