[IntelliJ] IntelliJ + Github ์ฐ๋ํ๊ธฐ
์ธํ ๋ฆฌ ์ ์ด๋ฅผ ํตํด ๊ฐ๋ฐ์ค์ธ ๋ก์ปฌ ํ๋ก์ ํธ๋ฅผ Github์ด๋ ์ฐ๋ํ๋ ๋ฐฉ๋ฒ์ ์์ ๋ณด๋ ค ํ๋ค.
๋ก์ปฌ ํ๋ก์ ํธ IntelliJ๋ก Github ์ฐ๋ํ๊ธฐ
์ธํ
๋ฆฌ์ ์ด์์ ๋ด๊ฐ ๋ง๋ค์๋ ํ๋ก์ ํธ๋ฅผ ๊นํ์ ์ฐ๋ ํ๋ ค๋ฉด ์ด๋ป๊ฒ ํด์ผ ํ๋ ์์๋ณด์.
โถ 1. Intellij Github ์ฐ๋ ์ค์
1) Git ์คํ ์ค์
- File >> Settings ํด๋ฆญ
- ์ค์นํ์๋ Git์ ์คํํ์ผ ๊ฒฝ๋ก๋ฅผ ์ง์
( ํน์ Git์ด ์ค์น ์๋์ด ์๋ค๋ฉด ๋ค์ ๋ด์ฉ ์ฐธ๊ณ - https://goddaehee.tistory.com/216)
2) GitHub ๊ณ์ ์ฐ๋
- GitHub๊ณผ IntelliJ ์ฐ๋์ ์ํด ๊ธฐ์กด์ ์์ฑํ์๋ GitHub๊ณ์ ์ ๋ฑ๋ก ํ๋ค.
(ํน์ GitHub ๊ฐ์ ์ด ์๋์ด ์๋๊ฒฝ์ฐ ๋ค์ ์ฐธ๊ณ - https://goddaehee.tistory.com/218)
- ๊ณ์ ๋ฐ Password ์ ๋ ฅ
โถ 2. Intellij Github ์ฐ๋
1) ์ฒซ๋ฒ์งธ ๋ฐฉ๋ฒ : ํ๋ก์ ํธ ๋ช ์ผ๋ก ์๋์ผ๋ก Repository๋ฅผ ์์ฑํ์ฌ Github ์ฐ๋
- VCS >> Import into Version Control >> Share Project on Github ํด๋ฆญ
- ์ต์ด Commit
- ๊ธฐ์กด ํ๋ก์ ํธ ๋ช ๊ณผ ๋์ผํ๊ฒ Github๊ณผ ์ฐ๋๋ ๊ฒ์ ๋ณผ ์ ์๋ค.
2) ๋๋ฒ์งธ ๋ฐฉ๋ฒ : Github์์ Repository๋ฅผ ์์ฑํ์ฌ Github ์ฐ๋
- Github Repository ์์ฑ
- VCS >> Import into Version Control >> Create Git Repository... ํด๋ฆญ
- ์ํ๋ ํ๋ก์ ํธ ์ ํ
- Project ํด๋์์ ๋ง์ฐ์ค ์ฐํด๋ฆญ >> Git >> Add ๋ฉ๋ด ํด๋ฆญ
( Add๋ฅผ ํตํ ์คํ
์ด์ง ์์ญ ํ์ผ ์ถ๊ฐ ์์
์ด๋ค. ($git add [ <ํ์ผ๋ช
> | * ])
( Commit ์ Add ๋ฅผ ํตํด ์ค๋น์์ญ(Staging)์ ์ฝ๋๋ฅผ ์ ์ฅํ๋ ์์
์ฒ๋ฆฌ ๋ฐฉ๋ฒ.)
- Projectํด๋์์ ๋ง์ฐ์ค ์ฐํด๋ฆญ >> Git >> Commit Directory
(Commit์ ํตํ ๋ฐฐํฌ ํ์ ($git commit -m "commit ์ค๋ช
"))
(Commitํ์ฌ Local Repository(Head) ์ ์ฝ๋๋ฅผ ์ ์ฅํ๋ ์์
์ด๋ค.
์ฆ, ๋ณ๊ฒฝ์ฌํญ์ ํ์ ํ์ฌ Local ์์ญ์ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ด๋ค.)
- ๋ณ๊ฒฝ ํ์ผ์ Font-Color์ ์๋ฏธ๋ ์๋์ ๊ฐ๋ค.
Red - Workspace Files
Green - Staged Files
Blue - Modified Files
White - Commited Files
Gray - Deleted Files
- Projectํด๋์์ ๋ง์ฐ์ค ์ฐํด๋ฆญ >> Git >> Repository >> Push
($gir remote add origin [์๊ฒฉ์๋ฒ์ฃผ์])
(Local Repository => Remote Repository ๋ก ์์ค๋ฅผ ๋ฐํํ๋ ๋จ๊ณ์ด๋ค.)
- Define remote๋ฅผ ํด๋ฆญํ์ฌ ์ข์ ์ ๋ง๋ค์ด ์ฃผ์๋ Repository ๊ฒฝ๋ก๋ฅผ ์ ๋ ฅํ๋ค.
- ๋ณ๊ฒฝ๋ ํ์ผ์ ํ์ธ ํ Push ๋ฒํผ์ ํด๋ฆญ ํ๋ค.
โป ์ฐธ๊ณ
- ํน์ ํ๋ก์ ํธ๋ฅผ ์์ฑํ ๋ ์๋์ผ๋ก READEME.md ํ์ผ์ ์์ฑํ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์์ผ๋ ์ฐธ๊ณ ํ์.
- ๋๊ฐ์ง ๋ฐฉ๋ฒ์ ํตํด GitHub๊ณผ ๋ก์ปฌ ํ๋ก์ ํธ์ ์ฐ๋ํ๋ ๋ฐฉ๋ฒ์ ์์ ๋ณด์๋ค.
โถ 3. Github Repository Clone
1) Clone์ ํตํด Repository๋ฅผ ๊ฐ์ ธ์ค์.
- SVN์ CheckOut์ ๊ฐ๋ ๊ณผ ์ ์ฌํ๋ค.
- Remote Repository์ ์์ค ์ฝ๋๋ฅผ Local๋ก ๊ฐ์ ธ์ด๊ณผ ๋์์ Local Repository๋ฅผ ์์ฑํ๋ค.
- VCS >> Get from Version Control... ํด๋ฆญ
- Repository URL์ ํตํด ์ฐ๋ํ๊ฑฐ๋, GitHub ๊ณ์ ์ ํ๋ก์ ํธ๋ฅผ ์ง์ ์ ํํ์ฌ ์ฐ๋ ๊ฐ๋ฅํ๋ค. Clone ๋ฒํผ์ ํด๋ฆญ.
์ด๋ก์จ ๊ฐ๋จํ๊ฒ IntelliJ์ Github์ ํตํด ํ๋ก์ ํธ๋ฅผ ์ฐ๋ํ๋ ๋ฐฉ๋ฒ๋ค์ ์์ ๋ณด์๋ค.
'๊นํ๋ธ๐ฑ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์ค๋ฅ๐ฅ] ๊นํ๋ธ ์ฐ๊ฒฐ ํด์ ๋ฐ ๋ค์ ์ฐ๊ฒฐ (0) | 2023.04.10 |
---|---|
[์ค๋ฅ๐ฅ] Can't open local terminal (0) | 2023.04.10 |
[์ธํ ๋ฆฌ๐ฑ] ์๊ฒฉ์ ์ฅ์ ๐ ๋ก์ปฌ์ ์ฅ์๋ก ์ด๋ฏธ ๋ง๋ค์ด์ง๊ฒ ๊ฐ์ ธ์ฌ๋ (0) | 2023.04.07 |
[์ธํ ๋ฆฌ๐ฑ] ์๊ฒฉ์ ์ฅ์ ๐ ๋ก์ปฌ์ ์ฅ์ ์ฌ๋ฆฌ๊ธฐ (0) | 2023.04.06 |
์๊ฒฉ์ ์ฅ์ -> ๋ก์ปฌ์ ์ฅ์ ๊ฐ์ ธ์ค๊ธฐ [pull, fetch, clone] (0) | 2023.03.27 |