Git
- ๊น์ ๋ถ์ฐ ๋ฒ์ ๊ด๋ฆฌ ์์คํ ์ผ๋ก ์์ค์ฝ๋ ํ์๊ด๋ฆฌ๋ฅผ ํ๋ ๋ฐ ์ฌ์ฉ๋๋ค.
- Git์ ์ฌ์ฉํ๋ฉด ์ฌ๋ฌ๋ช ์ด ํ์ ์ด ์ฉ์ดํ๋ฉฐ ๋ฐ๋ ์ฝ๋๋ฅผ ํจ๊ณผ์ ์ผ๋ก ๊ด๋ฆฌํ ์ ์๋ค.
Git์ ํ๋ก์ ํธ ์ฌ๋ฆฌ๊ธฐ
1.
GitHub์ ์ ์ฅ์ ์์ฑ
https://github.com/
GitHub ยท Build and ship software on a single, collaborative platform
Join the world's most widely adopted, AI-powered developer platform where millions of developers, businesses, and the largest open source community build software that advances humanity.
github.com
GitHub ๊ณ์ ์ด ํ์ํ๊ธฐ ๋๋ฌธ์ ํ์๊ฐ์
์ ๋จผ์ ํด์ผํ๋ค.

๋ด ํ๋กํ์ ๋ค์ด๊ฐ๋ฉด ์๋จ์ Repositories ๊ฐ ์๋ค.
Repositories > ์ฐ์ธก ์๋จ New ํด๋ฆญํ๋ค.

2.
Repository name (์ ์ฅ์ ์ด๋ฆ)์ ์
๋ ฅํ๋ค.
๊ทธ ๋ฐ์ ์ ์ฅ์์ ๊ณต๊ฐ์ฌ๋ถ, ๋ฆฌ๋๋ฏธ ๋ฑ ์ต์
์ ์ ํํ ์ ์๋ค.

์ ์ฅ์ ์์ฑ์ ๋๋ฅด๋ฉด ์์ ๊ฐ์ ํ๋ฉด์ด ๋์ค๋๋ฐ ์ ์ฅ์ ์ฃผ์๋ฅผ ๋ณต์ฌํด๋๋๋ค.
ํ๋ก์ ํธ์ Git์ ์ฐ๊ฒฐํ๊ธฐ ์ํด ํ์ํ๋ค.
3.
ํ๋ก์ ํธ๊ฐ ์๋ ๊ฒฝ๋ก๋ก ๊ฐ์ ์๋์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ๋ค.
$ git init
$ git remote add origin (GitHub ์ฃผ์)
๊ทธ ๋ค์์ git status ๋ช
๋ น์ด๋ฅผ ์ณ๋ณด๋ฉด git์ด ์ ๋๋ก ์ฐ๊ฒฐ๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
4.
$ git add (commitํ ํ์ผ๋ช
)
git add ๋ช
๋ น์ด๋ก commitํ ํ์ผ์ ์ถ๊ฐํ๋ค.
git add . ์ ์ด์ฉํ๋ฉด ๋ชจ๋ ํ์ผ์ ์ถ๊ฐํ ์ ์์ง๋ง ์ค์ ํ์ผ ๋ฑ ๋ชจ๋ ํ์ผ์ด ๋ค ์ฌ๋ผ๊ฐ๋ค๋ ์ ์ ์ฐธ๊ณ ํ๋ค.
5.
$ git commit -m "initial commit"
commitํ ํ์ผ์ ๋ชจ๋ ์ฌ๋ ธ์ผ๋ฉด git commit ๋ช
๋ น์ด๋ก ์ปค๋ฐ๋ฉ์์ง์ ํจ๊ป ํ์ผ๋ค์ ์ปค๋ฐํ๋ค.
6.
$ git push origin master
master ๋ธ๋์น์ commitํ ์์ค๋ฅผ push ํ๋ค.
7.
Github์ ๋ค์ด๊ฐ์ ์ฒ์์ ๋ง๋ค์๋ ์ ์ฅ์์ ๊ฐ๋ฉด ์์ค๋ค์ด ์ ๋๋ก ์ ๋ก๋ ๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
'Infra > Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [Git] ๊นํ๋ธ ์ด์ ๋ฑ๋ก ํ์์ฑ๊ณผ Issue Template ์์ฑํ๊ธฐ (2) | 2026.02.08 |
|---|---|
| [Git] ์ด๋ฏธ Pushํ Commit ๋ฉ์์ง ์์ ํ๊ธฐ + GitHub Token ์ธ์ฆ (4) | 2025.11.22 |
| [Git] Commit ๋ฉ์ธ์ง ๊ท์น (0) | 2025.11.20 |