1. Github๊ฐ์
ํ๊ธฐ2. Repository ์์ฑ3. Github์ ์ฌ๋ฆฌ๊ธฐ3-1. GUI๋ฅผ ์ด์ฉํ์ฌ Github์ ์ฌ๋ฆฌ๊ธฐ3-2. CLI๋ฅผ ์ด์ฉํ์ฌ Github์ ์ฌ๋ฆฌ๊ธฐ 4. Push๊ฐ ์๋ ๋4-1. token ๋ฐ๊ธํ๊ธฐ4-2. SSH Key ์์ฑํ๊ธฐ5. Git clone6. Git pull
1. Github๊ฐ์ ํ๊ธฐ
์๋ ํ์ด์ง๋ก ๋ค์ด๊ฐ ํ์ ๊ฐ์
์ ํด์ฃผ์ธ์! ๋ฉ์ผ์ธ์ฆ๊น์ง ํ์
์ผ ํฉ๋๋ค.
ย
์ํ๋ ์ด๋ฉ์ผ์ ์
๋ ฅํ๊ณ Sign up for GitHub์ ํด๋ฆญํ์ ํ ํ์๊ฐ์
์ ์งํํฉ๋๋ค.

ย
2. Repository ์์ฑ
๋ก๊ทธ์ธ์ด ๋์
จ๋ค๋ฉด ์๋ new๋ฅผ ํด๋ฆญํฉ๋๋ค.

ย
๋ ํ์งํ ๋ฆฌ ์ด๋ฆ์ ์ค์ ํ๊ณ Public(๊ณต๊ฐ)/Private(๋น๊ณต๊ฐ)๋ฅผ ์ค์ ํ์ ํ, Add a README file์ ํด๋ฆญํ์ฌ README file ์ถ๊ฐํฉ๋๋ค. ์ค์ ์ด ์๋ฃ๋๋ฉด Create Repository๋ฅผ ํด๋ฆญํฉ๋๋ค.

ย
3. Github์ ์ฌ๋ฆฌ๊ธฐ
3-1. GUI๋ฅผ ์ด์ฉํ์ฌ Github์ ์ฌ๋ฆฌ๊ธฐ
Add file > Upload File > 001.html

ย
3-2. CLI๋ฅผ ์ด์ฉํ์ฌ Github์ ์ฌ๋ฆฌ๊ธฐ
์์
ํ ํ๋ก์ ํธ ํด๋์ Github ์๊ฒฉ ์ ์ฅ์ ์ฃผ์ ์๋ ค์ฃผ๊ณ (remote add) Github์ main ๋ธ๋์น์ ์ฌ๋ฆฌ๊ธฐ(push)
$ git remote add origin https://github.com/id/filename.git $ git push -u origin main
ย


ย
push๊ฐ ์๋ฃ๋๋ฉด Github์ ์ ์ฌ๋ผ๊ฐ๋์ง ํ์ธํฉ๋๋ค.
ย
4. Push๊ฐ ์๋ ๋
push ํ ๋ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ ์ ์์ต๋๋ค. 2021๋
8์ 13์ผ๋ถํฐ ๋น๋ฐ๋ฒํธ ์ธ์ฆ ์ง์์ ์ฐ์ง ๋ชปํ๋๋ก ๋ณด์ ์
๋ฐ์ดํธ๊ฐ ๋์๊ธฐ ๋๋ฌธ์
๋๋ค.
remote: support for password authentication was removed on august 13, 2021. please use a personal access token instead.
ย
๋น๋ฐ๋ฒํธ ๋์ token ์ด๋ ssh ๋๊ฐ์ง ์ค ํ๋๋ก ์ธ์ฆ์ ํด์ผํฉ๋๋ค.
4-1. token ๋ฐ๊ธํ๊ธฐ
- Github ์๋จ์ ์๋ ๊ฐ์ธ ํ๋กํ์ ํด๋ฆญํ ํ, Settings๋ฅผ ํด๋ฆญํฉ๋๋ค.

- ์ข์ธก ๋ฉ๋ด์์ Developer settings > Personal access token > Generate new token์ ํด๋ฆญํฉ๋๋ค.

- ๋น๋ฐ๋ฒํธ๋ฅผ ์ ๋ ฅํ ํ, ํ ํฐ์ ์์ฑํฉ๋๋ค. ํ ํฐ ์ด๋ฆ, ํ๊ฐํ ๊ถํ์ ์ฒดํฌํ ํ์ Generate token์ ํด๋ฆญํฉ๋๋ค.
- ์์ฑ๋ ํ ํฐ์ ๋ณต์ฌํ๊ณ ํ์ํ ๊ณณ์ ์ฌ์ฉํฉ๋๋ค. ์ด๋ ํ ํฐ์ ํ๋ฒ๋ง ๋ณด์ฌ์ง๊ธฐ ๋๋ฌธ์ ์์ ํ ๊ณณ์ ๋ณด๊ดํฉ๋๋ค. ๋ฐ๊ธ๋ ํ ํฐ์ ๋ถ์ฌ๋ ๊ถํ๋ง ๋ณผ ์ ์๊ณ ํ ํฐ์ ๋ณผ ์ ์์ต๋๋ค.
์ฌ๋ฐ๊ธ์ ์ํ์๋ ๊ฒฝ์ฐ์๋ ์ฌ๋ฐ๊ธํ๊ณ ์ ํ๋ ํ ํฐ์ ํด๋ฆญ ํ, Regenerate token์ ํด๋ฆญํ๋ฉด ์ฌ์์ฑ ๋ฉ๋๋ค.
- ๋ฐ๊ธ ์๋ฃ ํ, ์ด์์ฒด์ ์ ๋ง๊ฒ ์ ์ฉ์ํต๋๋ค.
- Windows
- Mac
์ ์ดํ > ์ฌ์ฉ์ ๊ณ์ > ์๊ฒฉ ์ฆ๋ช
๊ด๋ฆฌ์ > Windows ์๊ฒฉ์ฆ๋ช
> git:https//github.com ์ฐพ๊ธฐ > ํธ์ง > ์ํธ๋ฅผ token์ผ๋ก ๋์ฒด
ํค์ฒด์ธ ์ ๊ทผ > github.com ์ฐพ๊ธฐ > ์ํธ๋ฅผ token์ผ๋ก ๋์ฒด
ย
4-2. SSH Key ์์ฑํ๊ธฐ
- ssh key๋ฅผ ์์ฑํฉ๋๋ค. Github ๊ณ์ ์์ฑ ์ ์ฌ์ฉํ ์ด๋ฉ์ผ๊ณผ ๋น๋ฐ๋ฒํธ๋ฅผ ์ ๋ ฅํฉ๋๋ค.
$ ssh-keygen -t rsa -C "email@example.com" Enter file in which to save the key (/c/Users/paullab/.ssh/id_rsa): Enter๋ฅผ ๋๋ฆ ๋๋ค. Enter passphrase (empty for no passphrase): github password Enter same passphrase again: github password
- ๊ณต๊ฐํค๋ฅผ ๊ฐ์ ธ์ต๋๋ค. ๊ณต๊ฐํค๊ฐ ์ถ๋ ฅ๋๋ฉด ๋ณต์ฌํฉ๋๋ค.
$ cat ~/.ssh/id_rsa.pub
- Github ์๋จ์ ์๋ ๊ฐ์ธ ํ๋กํ์ ํด๋ฆญํ ํ, Settings๋ฅผ ํด๋ฆญํฉ๋๋ค.

- ์ข์ธก ๋ฉ๋ด์ SSH and GPG keys > New SSH key๋ฅผ ํด๋ฆญํ์ฌ SSH Key ์ด๋ฆ๊ณผ Key์ ๋ณต์ฌํ ๊ณต๊ฐํค๋ฅผ ๋ถ์ฌ๋ฃ์ต๋๋ค.
- SSH Key ๊ณต๊ฐํค๊ฐ ์ ๋ฑ๋ก๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค.

ย
5. Git clone
- ์๊ฒฉ ์ ์ฅ์์ ์ฝ๋๋ฅผ ์ปดํจํฐ์ ๋ฐ์์ฌ ์ ์์ต๋๋ค. ์ ์์ ๋๋ ํ ๋ฆฌ ๋ง๋ค๊ณ (mkdir) ์ด๋ํ๊ธฐ(cd)
$ mkdir filename $ cd filename $ git clone https://github.com/id/clone-filename.git .
ย


ย
ํด๋ก ์ ์ (.)์ ์ฐ๋ ์ด์ ๋ ํ์ฌ ํด๋์ ํด๋ก ๋ฐ๊ธฐ ์ํด์ ์
๋๋ค. ๋ง์ฝ, ์ (.)์ ์ ์ฐ์ ๊ฒฝ์ฐ ์ ํด๋๋ฅผ ์์ฑํฉ๋๋ค.
ย
- ๊ถํ์ด ์ฃผ์ด์ง ๊ฒฝ์ฐ์๋ ์์ค์ฝ๋ ์์ ํ ์ปค๋ฐ๊ณผ ํธ์ํ๊ธฐ
$ git status $ git add . $ git commit -m "์ถ๊ฐ ์์ ๋ด์ญ์ ๋๋ค." $ git push origin main
ย
push๊ฐ ์๋ฃ๋๋ฉด Github์ ์ ์ฌ๋ผ๊ฐ๋์ง ํ์ธํฉ๋๋ค.
ย
6. Git pull
์๊ฒฉ ์ ์ฅ์์ ์
๋ฐ์ดํธ ๋ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๊ณ ๋ณํฉํ ๋ ์ฌ์ฉํฉ๋๋ค.
git pull origin main
ย


ย