728x90

Git 8

[GitHub] ์›๊ฒฉ ์ €์žฅ์†Œ, ๋กœ์ปฌ ์ €์žฅ์†Œ, remote, push, clone, pull

1 . git clone ๋ช…๋ น์–ด๋กœ ๋กœ์ปฌ ์ €์žฅ์†Œ ์ƒ์„ฑํ•˜๊ธฐ git clone [๋‚ด ์›๊ฒฉ ์ €์žฅ์†Œ url] master ๋ธŒ๋žœ์น˜ ํด๋ก  git clone -b [๋ธŒ๋žœ์น˜๋ช…] [์›๊ฒฉ ์ €์žฅ์†Œ url] ํŠน์ • ๋ธŒ๋žœ์น˜ ํด๋ก  2. git remote ๋ช…๋ น์–ด๋กœ ์›๊ฒฉ ์ €์žฅ์†Œ, ๋กœ์ปฌ ์ €์žฅ์†Œ ์—ฐ๊ฒฐํ•˜๊ธฐ git remote ์—ฐ๊ฒฐ๋œ ์›๊ฒฉ(remote) ์ €์žฅ์†Œ ์—†์œผ๋ฉด ์•„๋ฌด๊ฒƒ๋„ ์ถœ๋ ฅ X git remote add origin [์›๊ฒฉ ์ €์žฅ์†Œ url] ์›๊ฒฉ ์ €์žฅ์†Œ ์—ฐ๊ฒฐ git remote show [์›๊ฒฉ ์ €์žฅ์†Œ ์ด๋ฆ„] ์›๊ฒฉ ์ €์žฅ์†Œ ์„ธ๋ถ€ ์ •๋ณด ๋ณด๊ธฐ 3. git push ๋กœ์ปฌ ์ €์žฅ์†Œ์— ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ๋“ค์„ ์›๊ฒฉ ์ €์žฅ์†Œ์— ์˜ฌ๋ฆฌ๊ธฐ git add . # ๋ณ€๊ฒฝ๋œ ๋ชจ๋“  ํŒŒ์ผ ์ถ”๊ฐ€ git commit -m "์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€" git push origin master #..

Git 2021.03.04

[GitHub] ๋ธŒ๋žœ์น˜ ๋ฎ์–ด ์”Œ์šฐ๊ธฐ

๋ณ€๊ฒฝ๋œ Upstream branch๋ฅผ develop branch๋กœ ๋ฎ์–ด์”Œ์šฐ๊ธฐ (์ตœ์‹ ์ƒํƒœ๋ฅผ pull) upstream์„ remote๋กœ ๋“ฑ๋ก upstream ๋‚ด์šฉ fetch develop branch์™€ upstream ๋ณ‘ํ•ฉ -> ์—ฌ๊ธฐ๊นŒ์ง€ ํ•˜๋ฉด ๋‚ด ์ฝ”๋“œ๊ฐ€ ์ตœ์‹  ์ฝ”๋“œ๋กœ ๋ฐ”๋€œ ๋‹ค์Œ ์ž‘์—…์„ ์œ„ํ•ด ์ง€๊ธˆ develop branch๋ฅผ push git remote add upstream "upstream git ์ฃผ์†Œ" git fetch upstream git merge upstream/develop git push origin develop (merge๋Š” upstream์ด ์ตœ์‹  ์ƒํƒœ๊ฐ€ ๋˜์—ˆ๋‹ค๋Š” ๋œป, ๋‚˜์™€ ํ˜‘์—…์ž๋“ค์€ ์ด ์ตœ์‹ ์˜ upstream์„ ๋‹ค์‹œ pull๋ฐ›์•„ ์ตœ์‹  ํ™˜๊ฒฝ์—์„œ ์ƒˆ๋กญ๊ฒŒ ์ž‘์—…ํ•ด์•ผํ•จ) ์ฐธ๊ณ : medium.com/..

Git 2021.03.04

[GitHub] init, add, commit, amend, checkout

์ด์   ์ •๋ง ์™ธ์šฐ๋ ค๊ณ  ์ž‘์„ฑํ•˜๋Š” ๊ธ€ git ๋ฒ„์ „ ๊ด€๋ฆฌ ์‹œ์ž‘ Init ๋ฒ„์ „ ๊ด€๋ฆฌํ•˜๊ณ  ์‹ถ์€ ํด๋”๋กœ ์ด๋™ ํ›„ git init git ์ƒํƒœ ํ™•์ธ status git status git add git add . working directory์˜ ๋ชจ๋“  ๊ฒƒ ์˜ฌ๋ฆฌ๊ธฐ git add *.py pythonํŒŒ์ผ๋งŒ ์˜ฌ๋ฆฌ๊ธฐ git add project/a/* ๋””๋ ‰ํ† ๋ฆฌ๋„ add ๊ฐ€๋Šฅ git add --update update ์˜ต์…˜์œผ๋กœ ํ˜„์žฌ git์ด ์ถ”์ ํ•˜๊ณ  ์žˆ๋Š” ํŒŒ์ผ๋งŒ add ํŒŒ์ผ์„ ์ž˜๋ชป addํ•œ ๊ฒฝ์šฐ rm์œผ๋กœ ํŒŒ์ผ ๋‹ค์‹œ ๋‚ด๋ฆฌ๊ธฐ ๊ฐ€๋Šฅ git rm --cached *.py staging area์— ์ €์žฅ๋˜์—ˆ๋˜ *.py ํŒŒ์ผ ์‚ญ์ œ๋จ --> git์ด ์ถ”์ ํ•˜์ง€ ์•Š์€ untracked file git rm --cached๋Š” staging are..

Git 2021.02.18

[GitHub] ๋ฆฌ๋“œ๋ฏธ(README.md) ํŒŒ์ผ ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ ์ž‘์„ฑ, ๋งˆํฌ๋‹ค์šด ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ

๋งˆํฌ๋‹ค์šด ๋งˆํฌ๋‹ค์šด ํ˜•์‹์˜ ํŒŒ์ผ์€ .md ํ™•์žฅ์ž๋ฅผ ๊ฐ€์ง„๋‹ค. Github repository์—์„œ README.md ๋ฆฌ๋“œ๋ฏธ ํŒŒ์ผ์€ ๋งˆํฌ๋‹ค์šด ํ˜•์‹ ์ค‘ ํ•˜๋‚˜๋กœ github ์ €์žฅ์†Œ์— ๋Œ€ํ•œ ์„ค๋ช…์„ ๋‹ด๋Š” ํŒŒ์ผ์ด๋‹ค. ```bash โ”œโ”€โ”€ data โ”‚ โ”œโ”€โ”€ train โ”‚ โ”œโ”€โ”€ test โ”‚ โ””โ”€โ”€ validation โ”œโ”€โ”€ code โ”‚ โ”œโ”€โ”€ train.py โ”‚ โ”œโ”€โ”€ classify.py โ”‚ โ”œโ”€โ”€ model.py โ”‚ โ””โ”€โ”€ dataset.py โ””โ”€โ”€ run.sh ``` ์œ„์™€ ๊ฐ™์ด ์œ ๋‹ˆ์ฝ”๋“œ ๋ฌธ์ž๋ฅผ ์‚ฌ์šฉํ•ด ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ๋ฅผ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋งˆํฌ๋‹ค์šด ๋ฌธ๋ฒ•์— ๋Œ€ํ•œ ์ ์€ en.wikipedia.org/wiki/Markdown Markdown - Wikipedia From Wikipedia, the free encycloped..

Git 2021.02.16

[GitHub] ์ƒˆ๋กœ์šด ๋ธŒ๋žœ์น˜(branch) ๋งŒ๋“ค๊ธฐ

ํ˜‘์—… ์‹œ ์—ฌ๋Ÿฌ ๋ช…์ด ๋™์‹œ์— ๋‹ค๋ฅธ ์ž‘์—…์„ ํ•˜๋ ค๋ฉด branch๋ฅผ ๋งŒ๋“ค์–ด์•ผํ•œ๋‹ค. ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ์—ฌ๋Ÿฌ ๋ช…์ด์„œ ์„œ๋กœ ๋‹ค๋ฅด๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. CMD์—์„œ ์ž‘์—… 1. Branch ํ™•์ธ git branch ๋ธŒ๋žœ์น˜๋ฅผ ๋งŒ๋“ค๊ธฐ ์ „์—๋Š” master ๋ธŒ๋žœ์น˜๋งŒ ์กด์žฌํ•œ๋‹ค. git branch -r : ์›๊ฒฉ ์ €์žฅ์†Œ์˜ branch ๋ฆฌ์ŠคํŠธ ํ™•์ธ git branch -a : ๋กœ์ปฌ, ์›๊ฒฉ ์ €์žฅ์†Œ์˜ branch ๋ฆฌ์ŠคํŠธ ํ™•์ธ git push origin --delete [๋ธŒ๋žœ์น˜๋ช…] : ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ์‚ญ์ œ 2. Branch ์ƒ์„ฑ ๋ฐ ์ด๋™ git branch [๋ธŒ๋žœ์น˜๋ช…] ์˜ˆ์‹œ๋กœ feature๋ผ๋Š” ์ด๋ฆ„์˜ ๋ธŒ๋žœ์น˜๋ฅผ ๋งŒ๋“ค์—ˆ๋‹ค. ์ƒ์„ฑ ํ›„ ๋‹ค์‹œ git branch ๋ช…๋ น์–ด๋กœ ํ™•์ธํ•˜๋ฉด feature ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ ์™„๋ฃŒ! ์ด์ œ ์ƒ์„ฑํ•œ ๋ธŒ๋žœ์น˜๋กœ ์ด..

Git 2021.02.09

Unit test๋ž€? ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ž‘์„ฑํ•ด์•ผ ํ•˜๋Š” ์ด์œ , ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ (+ GitHub)

Unit test(๋‹จ์œ„ ํ…Œ์ŠคํŠธ)๋ž€? ์ „์ฒด ์ฝ”๋“œ ์ค‘ ์ž‘์€ ๋ถ€๋ถ„์„ ํ…Œ์ŠคํŠธํ•˜๋Š” ์ฝ”๋“œ ํ•จ์ˆ˜ ํ•˜๋‚˜ํ•˜๋‚˜ ๊ฐœ๋ณ„๋กœ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋Š”์ง€ ์—†๋Š”์ง€ ์ฒดํฌํ•  ์ˆ˜ ์žˆ์Œ ์–ด๋– ํ•œ ๋ถ€๋ถ„์— ๋ฌธ์ œ๊ฐ€ ์žˆ๊ณ , ๊ณ ์น  ๋ถ€๋ถ„์ด ์–ด๋””์ธ์ง€ ๋ช…ํ™•ํ•˜๊ฒŒ ์•Œ ์ˆ˜ ์žˆ๊ฒŒ ์ž‘์„ฑํ•ด์•ผํ•จ ๊ฐ„๋‹จํ•˜๊ณ  ๋ช…ํ™•ํ•ด์•ผํ•จ Unit test ํ•„์š”์„ฑ ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋Š”์ง€ ์—†๋Š”์ง€ ์ฒดํฌํ•˜๋Š” ์œ ๋‹› ํ…Œ์ŠคํŠธ ๋งŒ๋“ค์–ด ๋‘ ์œผ๋กœ์จ ๋ฌธ์ œ ์‰ฝ๊ฒŒ ํ•ด๊ฒฐ ๊ฐ€๋Šฅ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๊ฐ€ ์ž‘์„ฑ์ด ์ž˜ ๋˜์–ด์žˆ์œผ๋ฉด ์–ด๋””์— ๋ฌธ์ œ๊ฐ€ ์žˆ๊ณ  ์–ด๋””๋ฅผ ๊ณ ์ณ์•ผ ํ• ์ง€ ๋ช…ํ™•ํ•˜๊ฒŒ ์•Œ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๊ฐœ๋ฐœ ์ค‘ ๋ฏธ๋ฆฌ ๋ฌธ์ œ ํŒŒ์•… ๊ฐ€๋Šฅ ๋ณต์žกํ•œ ๋ฆฌ์†Œ์Šค๋“ค์„ ๊ฐ€์ ธ์˜ค์ง€ ์•Š๊ณ  ์‰ฝ๊ฒŒ ์ฝ”๋“œ ์‹คํ–‰์‹œ์ผœ๋ณด๊ธฐ ์œ„ํ•ด ์ž‘์„ฑ ๋ฒ„๊ทธ๋ฅผ ์ดˆ๊ธฐ์— ์žก์•„๋‚ด๊ธฐ ์ข‹์Œ ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ API๋ฅผ ์ด์šฉํ•˜๋Š” ์˜ˆ์ œ์— ๋Œ€ํ•ด test code ์ž‘์„ฑ Ensemble_REST_API_Test.ipyn..

Git 2021.01.16

[Git] GIT, GitHub ๊ฐœ๋…, Git ํ˜‘์—…

Git VCS(Version Control System) ์ค‘ ํ•˜๋‚˜, ๋ฒ„์ „ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ ๋ถ„์‚ฐ ์†Œ์Šค ๋ฒ„์ „ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ ์„œ๋ฒ„๋ฅผ ๋ถ„์‚ฐ์‹œ์ผœ ๊ตฌ์ถ•ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜๋Š” software ์†Œ์Šค์ฝ”๋“œ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ๋„๊ตฌ Github Git์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ์„œ๋ฒ„ Git ์—…๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋Š” ์›น์‚ฌ์ดํŠธ ๊ฐœ๋ฐœ์ž๋“ค์ด ํ˜‘์—… ์‹œ ์‚ฌ์šฉํ•˜๋Š” ํ”Œ๋žซํผ ํ•œ ๊ฐœ์˜ ๋ฉ”์ธ ์„œ๋ฒ„์— ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๋กœ์ปฌ ์ปดํ“จํ„ฐ(์—ฌ๋Ÿฌ๋ช…์˜ ์‚ฌ์šฉ์ž)๊ฐ€ ์ ‘์†ํ•ด ์†Œํ†ตํ•˜๋Š” ๋ฐฉ์‹ ๊ฐ์ž์˜ ์ปดํ“จํ„ฐ์— (๋ฐฑ์—…ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ) ๋ถ„์‚ฐ๋˜์–ด ์žˆ๋‹ค. ๋‚ด ๋กœ์ปฌ ์ปดํ“จํ„ฐ ๋‚ด์— ์žˆ๋Š” ๋ธŒ๋žœ์น˜(branch): ๋กœ์ปฌ ๋ธŒ๋žœ์น˜ ์™ธ๋ถ€ ์„œ๋ฒ„์— ์žˆ๋Š” ๋ธŒ๋žœ์น˜: ๋ฆฌ๋ชจํŠธ ๋ธŒ๋žœ์น˜(์›๊ฒฉ ๋ธŒ๋žœ์น˜) ๋ช‡ ๊ฐ€์ง€ Git ๋ช…๋ น์–ด merge ํ•œ ๋ธŒ๋žœ์น˜์—์„œ ์™„์„ฑํ•œ ์ž‘์—…์„ ๋‹ค๋ฅธ ๋ธŒ๋žœ์น˜์— ๋ณ‘ํ•ฉํ•˜๊ธฐ add ์ˆ˜์ •ํ•œ ์ฝ”๋“œ ์„ ํƒํ•ด ์ถ”๊ฐ€ co..

Git 2021.01.16

[Git GUI] GitHub ์†Œ์ŠคํŠธ๋ฆฌ(SourceTree) ์‚ฌ์šฉ ์˜ˆ์ œ, ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ์ƒ์„ฑ ํ›„ ๊นƒ ํด๋ก , ์ปค๋ฐ‹ ํ›„ ํ‘ธ์‰ฌ

Git์„ ๋ช…๋ น์–ด๋กœ ์•ˆ ํ•˜๊ณ  GUI ์‚ฌ์šฉํ•ด ํด๋ฆญํด๋ฆญ์œผ๋กœ ํŽธํ•˜๊ฒŒ ๋ณด๊ธฐ 1. ์†Œ์ŠคํŠธ๋ฆฌ ์„ค์น˜ www.sourcetreeapp.com/ Sourcetree | Free Git GUI for Mac and Windows A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac. www.sourcetreeapp.com ์œ„ ๋งํฌ๋กœ ๋“ค์–ด๊ฐ€ ์šด์˜์ฒด์ œ์— ๋งž๋Š” ๊ฑธ๋กœ ์„ค์น˜ ์„ค์น˜ ์™„๋ฃŒ๋˜๋ฉด SSHํ‚ค๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๊ฒ ๋ƒ๋Š” ์•Œ๋ฆผ์ด ๋œจ๋Š”๋ฐ ๋ณดํ†ต ์—†์œผ๋ฏ€๋กœ ์•„๋‹ˆ์˜ค ์„ ํƒํ•˜๊ธฐ~ 2. github์—์„œ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ์ƒ์„ฑ ๋‚˜๋Š” test ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ๋ฅผ Private์œผ๋กœ ์ƒ์„ฑํ•ด ๋ณผ ๊ฒƒ์ด๋‹ค. Create re..

Git 2021.01.14
728x90