[๐ŸŽ€๊นƒ & ๊นƒํ—ˆ๋ธŒ] ๊นƒํ—ˆ๋ธŒ ์—…๋กœ๋“œ, ์—…๋ฐ์ดํŠธ, ํ˜‘์—… ๋ฐฉ๋ฒ•

์•ˆ์ง€์ˆ˜ยท2023๋…„ 2์›” 18์ผ
0
post-custom-banner

๐Ÿ‘‘ ๊นƒ๊ณผ ๊นƒํ—ˆ๋ธŒ ๊ฐœ๋…

  • ๊นƒํ—ˆ๋ธŒ: ์†Œ์Šค์ฝ”๋“œ๋ฅผ ์˜ฌ๋ฆฌ๋Š” ๊ณต๊ฐ„
  • ๊นƒ: ์†Œ์Šค์ฝ”๋“œ๋ฅผ ๋‚ด ์ปดํ“จํ„ฐ์—์„œ ์ธํ„ฐ๋„ท์— ์˜ฌ๋ ค์ฃผ๋Š” ์—ญํ• 

๐Ÿ‘‘ ๊นƒํ—ˆ๋ธŒ ์ฒ˜์Œ ์—…๋กœ๋“œ

์†Œ์Šค์ฝ”๋“œ๊ฐ€ ์žˆ๋Š” terminal์„ ํ†ตํ•ด์„œ
1. git init (*๋งจ ์ฒ˜์Œ์— ํ”„๋กœ์ ํŠธ๋ฅผ ์˜ฌ๋ฆด ๋•Œ!)
2. git add . (.์€ ๋ชจ๋“  ๊ฒƒ์„ ์˜๋ฏธ): ๋ชจ๋“  ํŒŒ์ผ์„ ์˜ฌ๋ฆฌ๊ฒ ๋‹ค
-> ํŠน์ • ํŒŒ์ผ๋งŒ ์˜ฌ๋ฆฌ๊ณ  ์‹ถ์œผ๋ฉด, git add (ํŒŒ์ผ๋ช…)
-> git status: ์˜ฌ๋ฆด ์ˆ˜ ์žˆ๋Š” ํŒŒ์ผ๋“ค์˜ ์ƒํƒœ๋ฅผ ์•Œ๋ ค์คŒ
3. git commit -m "commit name": ํžˆ์Šคํ† ๋ฆฌ๋ฅผ ๋งŒ๋“ค์–ด์คŒ
4. git remote add origin "๋ ˆํผ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ": ํ”„๋กœ์ ํŠธ์™€ ๋ ˆํผ์ง€ํ† ๋ฆฌ์˜ ์—ฐ๊ฒฐ๊ณ ๋ฆฌ ๋งŒ๋“ค์–ด์คŒ
-> ๋งํฌ๋Š” ๊นƒํ—ˆ๋ธŒ์—์„œ ๋ณต์‚ฌ ํ•ด์™€์•ผ ํ•จ
-> git remote -v ํ†ตํ•ด ํ™•์ธ
5. git push origin master: master ๋ธŒ๋žœ์น˜๋กœ ์ฝ”๋“œ๋ฅผ ๋ณด๋ƒ„

๐Ÿ‘‘ ๊นƒํ—ˆ๋ธŒ ์ฝ”๋“œ ์—…๋ฐ์ดํŠธ

  1. git add .
  2. git commit -m "first commit"
  3. git push origin master

๐Ÿ‘‘ ๊นƒํ—ˆ๋ธŒ๋กœ ํ˜‘์—…ํ•˜๊ธฐ

-> pull & push์˜ ๋ฐ˜๋ณต!!
: cmd์—์„œ ์ง„ํ–‰
F: ์‹ ์ž…/ ๐Ÿ˜€: ๋ฆฌ๋”
F:1. ๋‹ค์šด๋กœ๋“œ ํ•  ํ”„๋กœ์ ํŠธ์˜ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ•ด์˜ด

๋ฆฌ๋”์˜ ์†Œ์Šค์ฝ”๋“œ๋ฅผ ๊ฐ€์ ธ์™€ ์ˆ˜์ • ํ›„, master branch ์š”์ฒญ

F:2. git clone "1๋ฒˆ์˜ ์ฃผ์†Œ" "ํด๋” ์ด๋ฆ„": 1๋ฒˆ ์ฃผ์†Œ์˜ ํ”„๋กœ์ ํŠธ๋ฅผ ์ด๋Ÿฐ ํด๋”์— ๋„ฃ๊ฒ ๋‹ค
F:3. cd "ํด๋”์ด๋ฆ„"
F:4. code .
๋‚ด ํŒŒํŠธ ๋ถ€๋ถ„ ์ˆ˜์ • ํ›„ ์ฒ˜์Œ ์†Œ์Šค์ฝ”๋“œ์™€ ํ•ฉ์น˜๊ธฐ (terminal ์—ด์–ด์„œ)
F:5.git add .
F:6. git commit -m "์ปค๋ฐ‹ ์ด๋ฆ„"
F:7. git checkout -b "์ƒˆ๋กœ์šด ๋ธŒ๋žœ์น˜ ์ด๋ฆ„"
-> git push origin master ์ ˆ๋Œ€ ์•ˆ๋จ!! (master: ํšŒ์‚ฌ์˜ ์ตœ์ข… ์†Œ์Šค์ฝ”๋“œ์ž„!! master ์ ˆ๋Œ€ ์•ˆ ๋จ!!)
F:8. git push origin "์ƒˆ๋กœ์šด ๋ธŒ๋žœ์น˜ ์ด๋ฆ„"
F:9. ๊นƒํ—ˆ๋ธŒ๋กœ ๋‹ค์‹œ ๊ฐ€์„œ commit ๋ฉ˜ํŠธ ์จ์คŒ (master๋กœ ๋Œ•๊ธธ ์ˆ˜ ์žˆ๊ฒŒ ํ—ˆ๋ฝํ•ด์ฃผ์„ธ์š”~ ์ด๋Ÿฐ ๋Š๋‚Œ)
-> ๐Ÿ˜€: pull request: ๋‹ค๋ฅธ ํŒ€์›์ด ํ•œ ๋‚ด์šฉ๋“ค ์—ฌ๊ธฐ์— ๋“ค์–ด๊ฐ€์„œ, ํ™•์ธ ํ›„ merge pull request (master ๋ธŒ๋žœ์น˜๋กœ ๋‹น๊ฒจ์คŒ)

๋ฐ”๋กœ master๋กœ ๋™๊ธฐํ™” (pull)

  1. git add .
  2. git commit -m "์ปค๋ฐ‹ ์ด๋ฆ„"
  3. git pull origin master
  4. git push origin master

โญ• ๋™๊ธฐ๋“ค๊ณผ ํ”„๋กœ์ ํŠธ ํ˜‘์—…ํ•˜๋Š” ๊ฒฝ์šฐ

: ์ด๋ฏธ ๋ˆ„๊ตฐ๊ฐ€ ์ตœ์ดˆ๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ์˜ฌ๋ ค๋†“์•˜์„ ๊ฒฝ์šฐ

  • ๋‚ด๊ฐ€ ๊ทธ ์†Œ์Šค์ฝ”๋“œ๋ฅผ ๊ฐ€์ ธ์™€์„œ(pull) ์ˆ˜์ • ํ›„ ๋‹ค์‹œ ์—…๋กœ๋“œ(push)
  • ์†Œ์Šค์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ์˜ terminal์—์„œ git์„ ํ†ตํ•ด ์ง„ํ–‰
    ----------- cmd์ฐฝ์—์„œ ์ง„ํ–‰ (ํ”„๋กœ์ ํŠธ ๊ฐ€์ ธ์˜ค๊ธฐ) ----------------------
  1. cd "ํ”„๋กœ์ ํŠธ๋ฅผ ๋‹ค์šด ๋ฐ›์„ ํŒŒ์ผ์˜ ์ด๋ฆ„"
  2. git clone "ํ”„๋กœ์ ํŠธ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ(๋ณต์‚ฌ)" "ํด๋” ์ด๋ฆ„": ํด๋” ์ด๋ฆ„ ์•ˆ์จ์ฃผ๋ฉด 1์˜ ํด๋”๋กœ ๋“ค์–ด๊ฐ
  3. cd "ํด๋”์ด๋ฆ„"
  4. code .
    ----------- ํ”„๋กœ๊ทธ๋žจ terminal์—์„œ ์ง„ํ–‰ (์ˆ˜์ • ํ›„ ์—…๋กœ๋“œ) -------------
  5. git add .
    -> git status (ํŒŒ์ผ ์ƒํƒœ ํ™•์ธ)
  6. git commit -m "์ปค๋ฐ‹ ์ด๋ฆ„"
  7. git pull origin master
  8. git push origin master

์ฐธ๊ณ : https://www.youtube.com/watch?v=cwC8t9dno2s&t=0s

profile
์ง€์ˆ˜์˜ ์ทจ์ค€, ๊ฐœ๋ฐœ์ผ๊ธฐ
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€