MapleStory Finger Point

๐ŸŸ  Git

[Git] eclipse ๊นƒํ—ˆ๋ธŒ ํ˜‘์—… ๋ฐฉ๋ฒ• & ๋ธŒ๋ Œ์น˜

HYEJU01 2024. 7. 15. 20:50

[ eclipse  ๊นƒํ—ˆ๋ธŒ ํ˜‘์—… ๋ฐฉ๋ฒ• ]

 

1. ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•  ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ์ƒ์„ฑ

github ์—์„œ repositories ๋ฅผ ํ•˜๋‚˜ ์ƒ์„ฑํ•œ๋‹ค. 

 

2. ์ฝœ๋ผ๋ณด๋ ˆ์ดํ„ฐ ์ดˆ๋Œ€ํ•˜๊ธฐ

๊ฐ™์ด ํ˜‘์—…ํ•  ์‚ฌ๋žŒ์„ ์ดˆ๋Œ€ํ•œ๋‹ค. Collaborators

์ด๋•Œ ์ดˆ๋Œ€๋ฅผ ์ˆ˜๋ฝํ•ด์•ผํ•œ๋‹ค.

 

3. ์ดํด๋ฆฝ์Šค์™€ ๊นƒํ—ˆ๋ธŒ ์—ฐ๊ฒฐํ•˜๊ธฐ

์ดํด๋ฆฝ์Šค์—์„œ Import -> git -> clone 

์ด๋•Œ ๊นƒํ—ˆ๋ธŒ Settings > Developer-Settings > Token ์„ ์ƒ์„ฑํ•œ๋‹ค.

 

4. ์ž˜ ์—ฐ๊ฒฐ ๋˜์—ˆ๋Š”์ง€ ์„œ๋ฒ„ ์ผœ์„œ ํ™•์ธํ•ด์ฃผ๋ฉด ๋

 


 

[ ํ˜‘์—… ์‹œ ๊นƒ ํ—ˆ๋ธŒ ์‚ฌ์šฉ๋ฒ• ? ] 

 

(ํŒ€์žฅ)

 

  • ๋‚ด github ๊ณ„์ •์—ฐ๊ฒฐ
$git config --global user.email "๋ณธ์ธ์ด๋ฉ”์ผ์ฃผ์†Œ"
$git config --global user.name "๋ณธ์ธ์ด๋ฆ„"

 

 

  • ์ดˆ๊ธฐ ์ฝ”๋“œ ์—…๋กœ๋“œํ•˜๊ธฐ
$git remote add origin <github ์ฃผ์†Œ>
$git branch -M main
$git push -u origin main

 

 

  • Git branch ๋ธŒ๋ Œ์น˜ ๊ทœ์น™ ์ •ํ•˜๊ธฐ!
$git branch OOOO

$git checkout OOOO

 

  • ์ž‘์—…ํ•œ ์ฝ”๋“œ ์ €์žฅํ•˜๊ธฐ
$git add .
$git commit -m "<๋ฉ”์„ธ์ง€>"

 

 

  • ์ž‘์—…ํ•œ ์ฝ”๋“œ ๋ธŒ๋žœ์น˜ ์—…๋กœ๋“œ
$git push origin ๋ธŒ๋žœ์น˜์ด๋ฆ„

or 

$git pull origin ๋ธŒ๋žœ์น˜์ด๋ฆ„
$git push origin ๋ธŒ๋žœ์น˜์ด๋ฆ„

 

 

 


 

(ํŒ€์›)

 

 

  • Clone ํด๋ก   : ๊นƒํ—ˆ๋ธŒ Repository์— ์žˆ๋Š” ํŒŒ์ผ์„ ๋‚ด ๋กœ์ปฌ ์ปดํ“จํ„ฐ๋กœ ๋ณต์‚ฌํ•ด์˜ค๊ธฐ
$git clone ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ

 

  • โญ master ์—์„œ ๋จผ์ € pull ํ›„ branch ์ƒ์„ฑํ•ด์•ผํ•œ๋‹ค. (์•„๋‹ˆ๋ฉด ํ…… ๋นˆ ๋ธŒ๋žœ์น˜๋งŒ ์ƒ์„ฑ๋จ)

 

  • ๋ธŒ๋ Œ์น˜ ๋งŒ๋“ค๊ธฐ (๋กœ์ปฌ- ์›๊ฒฉ์ด ๋™์ผํ•œ ์ด๋ฆ„์˜ ๋ธŒ๋žœ์น˜์—ฌ์•ผ pull ๋ฐ›์•„์˜ฌ ์ˆ˜ ์žˆ๋‹ค)
$git branch OOOO

 

 

  • ํŒ€์› ์ž‘์—…๋ฌผ ๋ฐ›์•„์˜ค๊ธฐ
  • โญ ๋ณดํ†ต ์ž‘์—…ํ•˜๋Š” ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์ด ๋‹ค์‹œ main ๋ธŒ๋žœ์น˜ pull์„ ๋ฐ›์•„์•ผํ•œ๋‹ค. (์‚ฌ์ด๋“œ ์ดํŽ™ํŠธ ๋ฐ ์ถฉ๋Œ ๋ฐฉ์ง€!)
    (๊ทธ๋Ÿฌ๋‚˜ ํ”„๋กœ์ ํŠธ ๊ทœ๋ชจ๊ฐ€ ํฌ๊ณ  ์ž‘์—…์ด ํฌ๊ฒŒ ๊ฒน์น  ์ผ์ด ์—†๋‹ค๋ฉด ๋งค๋ฒˆ ๋ฐ›์„ ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค.)
$git pull origin OOOO

 

 

 

  • ๋ณธ์ธ ๋ธŒ๋žœ์น˜์—์„œ ์ฝ”๋“œ ์ž‘์—…ํ•˜๊ธฐ

 

  • ์ž‘์—… ์ฝ”๋“œ ์ €์žฅ
$git add.
$git status  //๋ณ€๊ฒฝ์‚ฌํ•ญ ํ™•์ธ๊ฐ€๋Šฅ
$git commit -m "์ปค๋ฐ‹๋ฉ”์„ธ์ง€"

 

 

  • ์ž‘์—… ์ฝ”๋“œ ๋ธŒ๋žœ์น˜์— ์—…๋กœ๋“œ
$git push origin ๋ธŒ๋žœ์น˜์ด๋ฆ„

or 

$git pull origin ๋ธŒ๋žœ์น˜์ด๋ฆ„
$git push origin ๋ธŒ๋žœ์น˜์ด๋ฆ„

 

 

 

  • ์ดํ›„ master ๋ธŒ๋žœ์น˜๋กœ ์ด๋™ํ•˜์—ฌ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„  pull ํ•œ๋‹ค.
$git checkout main
$git pull origin main

 

  • ์ž‘์—… ์ค‘์ธ ๋ธŒ๋žœ์น˜์—์„œ master ๋‚ด์šฉ์„ ๋ธŒ๋žœ์น˜์— merge ํ•œ๋‹ค.
$git merge main
$git push

 

 

  • full request ์š”์ฒญ 

(merge๋Š” ๋ชจ๋“  ํŒ€์›๋“ค์ด ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋ณดํ†ต ๋ณธ์ธ์ด ์ฑ…์ž„์ง„๋‹ค๋Š” ๋งˆ์ธ๋“œ๋กœ PR์„ ์˜ฌ๋ฆฐ ๋ณธ์ธ์ด Mergeํ•œ๋‹ค.)

 

 

 

  • ๋ณดํ†ต ๊ฐœ๋ฐœ์šฉ ๋ธŒ๋žœ์น˜๋ฅผ ๋งŒ๋“ค์–ด ์˜ค๋ฅ˜๋ฅผ ํ™•์ธํ•˜๊ณ  mergeํ•œ๋‹ค.