๋ชฉ์ฐจ
00. GIt, GITHUB
(1) GIT
- ๋น ๋ฅธ ์๋, ๋จ์ํ ๊ตฌ์กฐ
- ๋ถ์ฐํ ์ ์ฅ์๋ฅผ ์ง์ํ๊ณ ๋น์ ํ์ ๊ฐ๋ฐ ๊ฐ๋ฅ
- ๋์์์ ์ด ๊ฐ๋ฅํด ์์ฐ์ฑ ์ฆ๊ฐ
- ์์ ๋ด์ฉ์ commit ๋จ์๋ก ๊ด๋ฆฌํ๊ณ ์ํ๋ ์์ ์ผ๋ก checkout ๊ฐ๋ฅ
- ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ๋ฅผ branch๋ก ๊ฐ๋ฐํ์ฌ ์คํํ ์ ์์ผ๋ฉฐ merge๋ฅผ ํตํด ๋ฐ์

โญ ๊น โ ๊นํ โญ
๊น : ๋ฒ์ ๊ด๋ฆฌ ์ํํธ์จ์ด (VCS)
๊นํ: ๊น์ ํ ๋๋ก ํ๋ ์๊ฒฉ ์ ์ฅ์ (cf. ๋น๋ฒ์ผ,gitlab ...)
- github repository : ์๊ฒฉ ์ ์ฅ์
- ์์ ์ ํ๋ก์ ํธ ํด๋ : ๋ก์ปฌ ์ ์ฅ์
01. Git ๊ธฐ๋ณธ ๋ช ๋ น์ด
ํ์ฌ ์ํ ํ์ธ | git status |
์ ์ฒด ๋ก๊ทธ ํ์ธ | git log |
git ์ ์ฅ์ ์์ฑํ๊ธฐ | git clone |
์ ์ฅ์ ๋ณต์ ๋ฐ ๋ค์ด๋ก๋ | git clone [http: ~] |
์ ์ฅ์์ ์ฝ๋ ์ถ๊ฐ | git add / git add* |
์ปค๋ฐ์ ํ์ผ์ ๋ณ๊ฒฝ์ฌํญ์ ํ๋ฒ์ ๋ชจ๋ ํฌํจ | git add -A |
์ปค๋ฐ ์์ฑ | git commit -m "message" |
๋ณ๊ฒฝ ์ฌํญ ์๊ฒฉ ์๋ฒ ์ ๋ก๋ (push) | git push origin master |
์๊ฒฉ ์ ์ฅ์์ ๋ณ๊ฒฝ ๋ด์ฉ์ ํ์ฌ ๋๋ ํ ๋ฆฌ๋ก ๊ฐ์ ธ์ค๊ธฐ (pull) | git pull |
๋ณ๊ฒฝ ๋ด์ฉ์ merge ํ๊ธฐ ์ ์ ๋ฐ๋ ๋ด์ฉ ๋น๊ต | git diff [branch1] [branch2] |
02. Git Branch ๊ด๋ จ (์์ฑ, branch ํ์ธ, push etc)
ํด๋น ํด๋์ git ํ์ผ ์์ฑ | git init |
github ์ฃผ์์ ์ฐ๊ฒฐ | git remote add origin [github url] |
๋ธ๋์น ์์ฑ | git branch [branch name] |
ํด๋น ๋ธ๋์น๋ก ์ด๋ | git chechout [branch name] |
๋ธ๋์น๋ฅผ ์์ฑํ๊ณ ํด๋น ๋ธ๋์น๋ก ๋ฐ๋ก ์ด๋ | git branch -b [branch name] |
์ํ๋ ๋ธ๋์น๋ก ์ด๋ํ๋์ง ํ์ธ | git branch |
๋ชจ๋ ๋ธ๋์น ํ์ธ | git branch -a |
ํ์ผ ๋ฐ ํด๋ add | git add. |
์ปค๋ฐ | git commit -m "commit message" |
์ํ๋ ๋ธ๋์น๋ก pushํ์ฌ ์๊ฒฉ ์๋ฒ์ ์ ์ก | git push origin [branch name] |
๋ธ๋์น ์ญ์ | git branch -d [branch name] |
ํด๋น ๋ธ๋์น์ ๋ค๋ฅธ ๋ธ๋์น ์์ ์ฌํญ ๋ณํฉ | git merge [branch2] |
03. Git Config ์ค์ ๊ด๋ จ
์ ์ฒด config ๋ฆฌ์คํธ ํ์ธ | git config --list |
git config ์ค์ ๋ฐฉ๋ฒ | git config --global user.name "์ด๋ฆ" git config --global user.email "์ด๋ฉ์ผ@email.com" |
git config ์ญ์ | git config --unset user.name git config --unset user.email |
global๋ก ์ค์ ๋ ์ฌ์ฉ์ ์ญ์ | git config --unset --global user.name git config --unset --global user.email |
๐ ์ฐธ๊ณ ์๋ฃ
1. git Process Flow and Command - https://dev.to/mollynem/git-github--workflow-fundamentals-5496
2. git ๋ช ๋ น์ด - https://eehoeskrap.tistory.com/666
'๐ป cs' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CS] APS, ์๊ฐ ๋ณต์ก๋ ์ ๋ฆฌ (1) | 2024.01.30 |
---|---|
Spring | AOP์ ๋ํด ์์๋ณด์ !! (0) | 2023.07.27 |
IT ์๋น์ค, Cloud ์๋น์ค์ ๋ํด ์์๋ณด์ (0) | 2023.07.12 |
์นดํ ์ผ | 2์ฃผ์ฐจ ๊ณผ์ issue ํด๊ฒฐ (3) | 2023.07.11 |
WEB | API ์์๋ณด๊ธฐ (0) | 2023.06.29 |
00. GIt, GITHUB
(1) GIT
- ๋น ๋ฅธ ์๋, ๋จ์ํ ๊ตฌ์กฐ
- ๋ถ์ฐํ ์ ์ฅ์๋ฅผ ์ง์ํ๊ณ ๋น์ ํ์ ๊ฐ๋ฐ ๊ฐ๋ฅ
- ๋์์์ ์ด ๊ฐ๋ฅํด ์์ฐ์ฑ ์ฆ๊ฐ
- ์์ ๋ด์ฉ์ commit ๋จ์๋ก ๊ด๋ฆฌํ๊ณ ์ํ๋ ์์ ์ผ๋ก checkout ๊ฐ๋ฅ
- ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ๋ฅผ branch๋ก ๊ฐ๋ฐํ์ฌ ์คํํ ์ ์์ผ๋ฉฐ merge๋ฅผ ํตํด ๋ฐ์

โญ ๊น โ ๊นํ โญ
๊น : ๋ฒ์ ๊ด๋ฆฌ ์ํํธ์จ์ด (VCS)
๊นํ: ๊น์ ํ ๋๋ก ํ๋ ์๊ฒฉ ์ ์ฅ์ (cf. ๋น๋ฒ์ผ,gitlab ...)
- github repository : ์๊ฒฉ ์ ์ฅ์
- ์์ ์ ํ๋ก์ ํธ ํด๋ : ๋ก์ปฌ ์ ์ฅ์
01. Git ๊ธฐ๋ณธ ๋ช ๋ น์ด
ํ์ฌ ์ํ ํ์ธ | git status |
์ ์ฒด ๋ก๊ทธ ํ์ธ | git log |
git ์ ์ฅ์ ์์ฑํ๊ธฐ | git clone |
์ ์ฅ์ ๋ณต์ ๋ฐ ๋ค์ด๋ก๋ | git clone [http: ~] |
์ ์ฅ์์ ์ฝ๋ ์ถ๊ฐ | git add / git add* |
์ปค๋ฐ์ ํ์ผ์ ๋ณ๊ฒฝ์ฌํญ์ ํ๋ฒ์ ๋ชจ๋ ํฌํจ | git add -A |
์ปค๋ฐ ์์ฑ | git commit -m "message" |
๋ณ๊ฒฝ ์ฌํญ ์๊ฒฉ ์๋ฒ ์ ๋ก๋ (push) | git push origin master |
์๊ฒฉ ์ ์ฅ์์ ๋ณ๊ฒฝ ๋ด์ฉ์ ํ์ฌ ๋๋ ํ ๋ฆฌ๋ก ๊ฐ์ ธ์ค๊ธฐ (pull) | git pull |
๋ณ๊ฒฝ ๋ด์ฉ์ merge ํ๊ธฐ ์ ์ ๋ฐ๋ ๋ด์ฉ ๋น๊ต | git diff [branch1] [branch2] |
02. Git Branch ๊ด๋ จ (์์ฑ, branch ํ์ธ, push etc)
ํด๋น ํด๋์ git ํ์ผ ์์ฑ | git init |
github ์ฃผ์์ ์ฐ๊ฒฐ | git remote add origin [github url] |
๋ธ๋์น ์์ฑ | git branch [branch name] |
ํด๋น ๋ธ๋์น๋ก ์ด๋ | git chechout [branch name] |
๋ธ๋์น๋ฅผ ์์ฑํ๊ณ ํด๋น ๋ธ๋์น๋ก ๋ฐ๋ก ์ด๋ | git branch -b [branch name] |
์ํ๋ ๋ธ๋์น๋ก ์ด๋ํ๋์ง ํ์ธ | git branch |
๋ชจ๋ ๋ธ๋์น ํ์ธ | git branch -a |
ํ์ผ ๋ฐ ํด๋ add | git add. |
์ปค๋ฐ | git commit -m "commit message" |
์ํ๋ ๋ธ๋์น๋ก pushํ์ฌ ์๊ฒฉ ์๋ฒ์ ์ ์ก | git push origin [branch name] |
๋ธ๋์น ์ญ์ | git branch -d [branch name] |
ํด๋น ๋ธ๋์น์ ๋ค๋ฅธ ๋ธ๋์น ์์ ์ฌํญ ๋ณํฉ | git merge [branch2] |
03. Git Config ์ค์ ๊ด๋ จ
์ ์ฒด config ๋ฆฌ์คํธ ํ์ธ | git config --list |
git config ์ค์ ๋ฐฉ๋ฒ | git config --global user.name "์ด๋ฆ" git config --global user.email "์ด๋ฉ์ผ@email.com" |
git config ์ญ์ | git config --unset user.name git config --unset user.email |
global๋ก ์ค์ ๋ ์ฌ์ฉ์ ์ญ์ | git config --unset --global user.name git config --unset --global user.email |
๐ ์ฐธ๊ณ ์๋ฃ
1. git Process Flow and Command - https://dev.to/mollynem/git-github--workflow-fundamentals-5496
2. git ๋ช ๋ น์ด - https://eehoeskrap.tistory.com/666
'๐ป cs' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CS] APS, ์๊ฐ ๋ณต์ก๋ ์ ๋ฆฌ (1) | 2024.01.30 |
---|---|
Spring | AOP์ ๋ํด ์์๋ณด์ !! (0) | 2023.07.27 |
IT ์๋น์ค, Cloud ์๋น์ค์ ๋ํด ์์๋ณด์ (0) | 2023.07.12 |
์นดํ ์ผ | 2์ฃผ์ฐจ ๊ณผ์ issue ํด๊ฒฐ (3) | 2023.07.11 |
WEB | API ์์๋ณด๊ธฐ (0) | 2023.06.29 |