Git
Local์์ ๋ฒ์ ๊ด๋ฆฌ ํ๋ก๊ทธ๋จ
1. Git Download
Git
www.git-scm.com
2. ์ค์น
-๊ธฐ๋ณธ ์ถ์ฒ์ผ๋ก ์ค์น (Next ๊ณ์ ๋๋ฅด๊ธฐ)
Git-hub
์จ๋ผ์ธ ์ ์ฅ์ (Backup)
-git-hub.com
1. ํ์๊ฐ์
Git-fork
Local๊ณผ Remote(github)์ ์ฐ๊ฒฐ
1. git-fork download
2. ์ค์น
- git-hub์ ๊ฐ์ ํ ์ด๋ฆ๊ฐ ์ด๋ฉ์ผ ์ ๋ ฅ
Local์์ Repository์์ฑ ํ Remote๋ก Push
1. git-fork
1) git fork ์์ File -> init new Repository
2) ํ์์ฐฝ -> repository๋ก ์ฌ์ฉํ ํด๋(Java Project๋ก ์ฌ์ฉ ํ )๋ฅผ ์์ฑ ํ ์ ํ
3) repository ํด๋์ gitignore ํ์ผ ์์ฑ
4) git-fork์์ gitignoreํ์ผ์ stage๋ก ์ด๋ ํ commit
5) STS์์ Java project๋ฅผ ์์ฑ, ํ๋ก์ ํธ๋ช ์ Reository ์ด๋ฆ๊ณผ ๋์ผ ํ ๊ฒฝ๋ก์ ์ด๋ฆ
6) Git-hub์์ ๋์ผํ repository์ด๋ฆ์ผ๋ก ์๋ก์ด repository ์์ฑ
7) URL ์ฃผ์ ๋ณต์ฌ
8) git-fork์์ remote ์ฐํด๋ฆญ ํ๋ฉด ๋ณต์ฌํ ๋ด์ฉ์ด ์๋ ์ ์ฅ ํ์ธ
Remote์์ Repository ์์ฑ ํ Local pull
1) Git-hub์์ ์๋ก์ด repository ์์ฑ
a. repository ์ด๋ฆ ์ ๋ ฅ
b. public ์ ํ
c. Add .gitignore ํ์ผ ์ ํ(option, ๋์ค์ local์์ ๋ง๋ค์ด๋ ๋จ)
- java ์ ๋ ฅ ํ template ์ ํ
d. create repository ํด๋ฆญ
2) gitignore ํ์ผ ์์
a. gitignore ํ์ด์ง์์ ์ฐํ๋ชจ์ ํด๋ฆญ(์์ )
b. ๋ด์ฉ ์์
๊ธฐ์กด gitignoreํ์ผ ์ด์ด์ ๋ณต๋ถํด๋ ๋๊ณ
https://www.toptal.com/developers/gitignore
gitignore.io
Create useful .gitignore files for your project
www.toptal.com
์ฌ๊ธฐ ๋ค์ด๊ฐ์ ์ฌ์ฉํ๊ณ ์๋ ์ด์์ฒด์ ,๊ฐ๋ฐํ๊ฒฝ,์ธ์ด ๊ฒ์ํ ํ์ ๋ณต๋ถํด๋ ๋จ
c. commit changes ์์ ์ ๋ชฉ ์ ๋ ฅ ํ commit
3) URL ๋ณต์ฌ
a. ์ฒซ ํ๋ฉด์์ code ํด๋ฆญ
b. HTTPS URL ์ฃผ์ ๋ณต์ฌ
4) git-fork
a. File -> clone
b. ๋ณต์ฌํ URL์ Repository url์ ์ ๋ ฅ
c. Parent folder๋ workspace๋ก ๊ฒฝ๋ก
d. Name์ ์๋์ ๋ ฅ (Ropository ์ ๋์ผํ ์ด๋ฆ ์ ๋ ฅ)
e. clone ํด๋ฆญ
=> git-fork ์์ main ๋ณด์ด๊ณ workspace ํด๋์ ์ ๋๋ก ์์ฑ๋์ด์๋ ํ์ธ
5) STS
a. ํ๋ก์ ํธ ์์ฑ
b. ํ๋ก์ ํธ๋ช ์ Repository์ด๋ฆ๊ณผ ๋์ผํ๊ฒ
์์ ์์
0. Git-fork์์ pull ์งํ
1. STS ์ฝ๋ฉ ์์ ํ ์ ์ฅ
2. git-fork์์ ์ํ๋ ํ์ผ์ stage๋ก ์ด๋
3. commit ์ ๋ชฉ์ ์ ๋ ฅํ๊ณ commit ๋ฒํผ ํด๋ฆญ(Local์ ์ ์ฅ)
4. push -github์ upload
Delete
1. Git-hub Repository ์ญ์
- git-hub์์๋ง ์ญ์ Local์ ์ํฅ์ด ์์
a. ์ญ์ ํ Git-hub์ Repository์์ Setting ์ด๋
b. ํ๋จ์ Danger Zone์ Delete repository
c. ์์ ์์ด๋ฆ/repository์ด๋ฆ ์ ๋ ฅํ๊ณ ์ญ์
2. Local Git ์ญ์
- git-hub์ ํ๋ก์ ํธ ํ์ผ์๋ ์ํฅ์ด ์์
- git-fork์์๋ง ์๋ณด์ด๊ฒ ํ๋ ๊ฒ, git ์ค์ ์ ๋จ์ ์์
- git ์ค์ ์ ๋ชจ๋ ์ง์ฐ๋ ค๋ฉด repository ํด๋๋ด์ .git ํด๋๋ฅผ ์ญ์ ํด์ผ ํจ
a. git-fork์์ Repository Manager ์ด๊ธฐ
b. ํญ์ ๋ชจ๋ ๋ซ๊ฑฐ๋ + ๋ฒํผ ๋๋ฃจ๋ฉด Repository Manager๊ฐ ๋์ด
c. ์ญ์ ํ repository๋ช ์ฐํด๋ฆญ remove ์ ํ
3. Java project ์ญ์
a. sts์์ ์ญ์ ํ ํ๋ก์ ํธ๋ช ์ฐํด๋ฆญ -> delete
b. ์ฒดํฌ๋ฐ์ค์ ์ฒดํฌ๋ฅผ ํด์ผ HDD์์๋ ์์ ์ญ์
Git-hub์์ ์ฌ์ฉํ๋ Project(Repository) Clone
1) Git-hub์์ Repository URL ๋ณต์ฌ
a. Repository ์ฒซ ํ๋ฉด์์ code ํด๋ฆญ
b. HTTPS URL ์ฃผ์ ๋ณต์ฌ
2) git-fork
a. File -> clone
b. ๋ณต์ฌํ URL์ Repository url์ ์ ๋ ฅ
c. Parent folder๋ workspace๋ก ๊ฒฝ๋ก
d. Name ์ ์๋์ ๋ ฅ(Ropository ์ ๋์ผํ ์ด๋ฆ ์ ๋ ฅ)
e. clone ํด๋ฆญ
3) sts
a. file > import
b. General > Existing Project....
c. root directory > browser > workspace ํด๋ ์ ํ
d. ์ฌ์ฉํ Project๋ฅผ ์ฒดํฌ ํ๊ณ Finish
Git Ignore ํ์ผ์ ์์ฑ ํ ์ ์ฉ์ด ์๋ ๋
1) CMD(Terminal)์์ ํด๋น Repository๋ก ์ด๋ ํ
2) git rm -r --cached . && git add . && git commit -m "fixed untracked files"
Git user ๋ณ๊ฒฝ
1. CMD, Terminal
2. git config --global user.name ์ ์ ๋ช
git config --global user.email ์ ์ ์ด๋ฉ์ผ
/*
๊ธฐ๋ก์ฉ ๋ธ๋ก๊ทธ ์ ๋๋ค.
ํ๋ฆฐ ๋ถ๋ถ์ด ์์ผ๋ฉด ๋๊ธ๋ก ๋จ๊ฒจ์ฃผ์ธ์.
๊ฐ์ฌํฉ๋๋ค : )
*/
'23. ํ๊ฒฝ์ค์ ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๊ฒฝ์ค์ ] Spring Legacy project ์์ฑ (0) | 2022.02.16 |
---|---|
[Spring Legacy]Project ์์ฑ ํ ๊ธฐ๋ณธ์ค์ (0) | 2022.02.15 |
[ํ๊ฒฝ์ค์ ] ์ค์น ์ ๋ฐ์ํ ์ ์๋ Issue (0) | 2022.02.10 |
[ํ๊ฒฝ์ค์ ] Legacy ์ค์น, Encoding ์ค์ , WAS ์ค์น, STS ์ WAS ์ฐ๋, Spring Legacy Project ์์ฑ (0) | 2022.02.10 |
๊ฐ๋ฐํ๊ฒฝ AWS ํ์๊ฐ์ , Oracle DB ์์ฑ, SQL (0) | 2022.01.18 |