Search

Eclipse x Github ์—ฐ๋™

Eclipse x Github ์—ฐ๋™

2.
Github ํšŒ์›๊ฐ€์ž…
3.
Repository ์ƒ์„ฑ
4.
Git Clone
5.
Share Project
6.
Commit & Push
7.
Pull

Github ํšŒ์›๊ฐ€์ž…

Repository ์ƒ์„ฑ

Git Clone

git init โ†’ GitHub repository ์—ฐ๊ฒฐ โ†’ push ๋ฐฉ์‹

์ „์ œ ์กฐ๊ฑด

โ€ข
Eclipse๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์Œ
โ€ข
EGit ํ”Œ๋Ÿฌ๊ทธ์ธ ํฌํ•จ (๋ณดํ†ต Eclipse ๊ธฐ๋ณธ ํƒ‘์žฌ)
โ€ข
GitHub ๊ณ„์ • ์žˆ์Œ
โ€ข
GitHub์— **๋นˆ ์ €์žฅ์†Œ(repository)**๋ฅผ ๋ฏธ๋ฆฌ ๋งŒ๋“ค์–ด๋‘  (์˜ˆ: myproject)

๋‹จ๊ณ„๋ณ„ ์„ค์ •

ํ”„๋กœ์ ํŠธ์— Git ์ดˆ๊ธฐํ™” (git init)

1.
Eclipse Project Explorer์—์„œ ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ
2.
Team โ†’ Share Project... ํด๋ฆญ
3.
Git ์„ ํƒ โ†’ Next
4.
Create Repository ์ฒดํฌ โ†’ ๊ฒฝ๋กœ ํ™•์ธ ํ›„ Finish
โ†’ ์ด๋Ÿฌ๋ฉด .git ํด๋”๊ฐ€ ์ƒ๊ธฐ๋ฉฐ Git ์ดˆ๊ธฐํ™” ์™„๋ฃŒ

GitHub ์›๊ฒฉ ์ €์žฅ์†Œ(remote) ์—ฐ๊ฒฐ

1.
Git Repositories ๋ทฐ ์—ด๊ธฐ
(์ƒ๋‹จ ๋ฉ”๋‰ด โ†’ Window โ†’ Show View โ†’ Other... โ†’ Git โ†’ Git Repositories)
2.
๋ฐฉ๊ธˆ ๋งŒ๋“  ๋กœ์ปฌ ์ €์žฅ์†Œ ์„ ํƒ
3.
๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ํด๋ฆญ โ†’ Remotes โ†’ Create Remote...
4.
์ด๋ฆ„์— origin ์ž…๋ ฅ โ†’ OK
5.
Configure Push... ํด๋ฆญ
โ€ข
URI:
https://github.com/๊นƒํ—ˆ๋ธŒ์•„์ด๋””/๋ ˆํฌ์ด๋ฆ„.git
โ€ข
Username, Password (๋˜๋Š” Personal Access Token ์ž…๋ ฅ)
6.
Next โ†’ Finish

์ปค๋ฐ‹(commit) & ํ‘ธ์‹œ(push)

1.
ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ โ†’ Team โ†’ Commit...
2.
์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ์ž…๋ ฅ ํ›„ Commit and Push ํด๋ฆญ
3.
๋ธŒ๋žœ์น˜ ์ด๋ฆ„(main ๋˜๋Š” master) ํ™•์ธ โ†’ Finish
์ด์ œ GitHub์—์„œ ์ƒˆ๋กœ๊ณ ์นจํ•˜๋ฉด ์ฝ”๋“œ๊ฐ€ ์˜ฌ๋ผ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค

์ฐธ๊ณ  (ํ„ฐ๋ฏธ๋„ ๋ช…๋ น์œผ๋กœ ๋™์ผํ•˜๊ฒŒ ํ•˜๋ ค๋ฉด)

cd your_project git init git add . git commit -m "first commit" git branch -M main git remote add origin https://github.com/username/repo.git git push -u origin main
Bash
๋ณต์‚ฌ

์—๋Ÿฌ ์ž์ฃผ ๋‚˜๋Š” ๋ถ€๋ถ„

๋ฌธ์ œ
์›์ธ
ํ•ด๊ฒฐ
rejected non-fast-forward
GitHub์— ๊ธฐ์กด ์ฝ”๋“œ๊ฐ€ ์žˆ์Œ
GitHub repo ๋น„์šฐ๊ฑฐ๋‚˜ git pull --rebase origin main ํ›„ ๋‹ค์‹œ push
์ธ์ฆ ์‹คํŒจ
ํ† ํฐ ๋ฏธ์‚ฌ์šฉ
GitHub Personal Access Token ๋ฐœ๊ธ‰ ํ›„ ์‚ฌ์šฉ
๋ธŒ๋žœ์น˜ ๋‹ค๋ฆ„
master vs main ๋ถˆ์ผ์น˜
git branch -M main์œผ๋กœ ํ†ต์ผ