DevOps

commit ํ•œ ๊ฒƒ์„ push ํ–ˆ๋Š”๋ฐ ์ž˜๋ชป ์˜ฌ๋ฆฌ๊ฒŒ ๋˜์–ด ๊ทธ commit์„ ํ”์ ๋„ ์—†์ด ์ง€์šฐ๊ณ  ์‹ถ๋‹ค๋ฉด git revert ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค. git log ๋ฅผ ํ†ตํ•ด์„œ commit ์ด๋ ฅ์„ ํ™•์ธํ•œ ๋’ค, ์ด๋™ํ•˜๊ณ  ์‹ถ์€ commit์˜ id ๋ฅผ ์ฐพ๋Š”๋‹ค. git reset [commit id] ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์›ํ•˜๋Š” commit ์œผ๋กœ ์ด๋™ ํ›„ git push origin main ํ•˜๋ฉด ๋!! ์ด๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค๋ฉด? git push origin +main ํ•˜๋ฉด ๋ [์ถœ์ฒ˜] https://velog.io/@rkio/Git-push-%EC%B7%A8%EC%86%8C%ED%95%98%EA%B8%B0
CI์—๋Š” ๋ฌด์—‡์ด ํ•„์š”ํ• ๊นŒ? 1. ๋ฒ„์ „ ๊ด€๋ฆฌ ๋„๊ตฌ CI์—๋Š” git๊ณผ ๊ฐ™์€ ๋ฒ„์ „ ๊ด€๋ฆฌ ๋„๊ตฌ๊ฐ€ ํ•„์š”ํ•˜๋‹ค. ๋ฒ„์ „ ๊ด€๋ฆฌ ๋„๊ตฌ๊ฐ€ ์†Œ์Šค์ฝ”๋“œ์˜ ์ˆ˜์ •๊ณผ ๋ฐฑ์—…์„ ์ž๋™ํ™” ํ•  ์ˆ˜ ์žˆ๊ณ , ์—ฌ๋Ÿฌ๋ช…์ด ๊ณต๋™์œผ๋กœ ๊ฐœ๋ฐœํ•œ ๋‚ด์šฉ์„ ๋™๊ธฐํ™”ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋„์™€์ฃผ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ๋ฒ„์ „ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์ด ๊ด€๋ฆฌํ•˜์ง€ ์•Š๋Š” ์†Œ์Šค์ฝ”๋“œ๋Š”, ๊ฐœ๋ฐœ ๋‹จ๊ณ„์—์„œ ์ž๋™ํ™”๊ฐ€ ๋˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— CI๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์€ ๋ฌด์˜๋ฏธํ•˜๊ฒŒ ๋œ๋‹ค. ๐Ÿ“ ์˜ˆ) git, Subversion, Mercurial ๋“ฑ 2. CI ๋„๊ตฌ(CI tool) CI ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด, ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰์„ ํ†ตํ•ด ๋‹ค์–‘ํ•œ ์ž‘์—…์„ ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฒ„์ „ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์—์„œ ์†Œ์Šค์ฝ”๋“œ๋ฅผ ์ฃผ๊ธฐ์ ์œผ๋กœ ํด๋ง(polling)ํ•˜๊ณ , ํ…Œ์ŠคํŠธ๋ฅผ ์‹คํ–‰ํ•˜๊ฑฐ๋‚˜, ๋นŒ๋“œ๋ฅผ ํ•˜๋Š” ๋“ฑ phthon, groovy, shell๊ณผ ๊ฐ™์€ ์Šคํฌ๋ฆฝํŠธ ์–ธ์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ CI..
๐Ÿ“ ์ปดํŒŒ์ผ complier๋ฅผ ํ†ตํ•ด java์™€ ๊ฐ™์€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ๊ธฐ๊ณ„๊ฐ€ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ์–ธ์–ด๋กœ ๋ฒˆ์—ญํ•ด์ค€๋‹ค. ๐Ÿ“ ๋นŒ๋“œ(Build) ์†Œ์Šค์ฝ”๋“œ ํŒŒ์ผ์„ ์‹คํ–‰๊ฐ€๋Šฅํ•œ ์†Œํ”„ํŠธ์›จ์–ด ์‚ฐ์ถœ๋ฌผ๋กœ ๋งŒ๋“œ๋Š” ์ผ๋ จ์˜ ๊ณผ์ • # Build Tool preprocessing → complie → packaging → testing → distribution java์—์„œ๋Š” maven, gradle๊ณผ ๊ฐ™์€ build ๋„๊ตฌ๋ฅผ ํ†ตํ•ด ์ปดํŒŒ์ผ๊ณผ ํ•จ๊ป˜ ์†Œ์Šค์ฝ”๋“œ ํŒŒ์ผ์„ .jar, .war๊ณผ ๊ฐ™์€ ๊ฒƒ์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๋นŒ๋“œ๋„ ํ•จ๊ป˜ ์ˆ˜ํ–‰ ๐Ÿ“ ๋ฐฐํฌ ๋ฐฐํฌ๋ฅผ ํ•œ ์ƒํ™ฉ์—์„œ ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š๊ฒŒ ๋™์ž‘ํ•˜์—ฌ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€์„ ๋•Œ, ๊ฐœ๋ฐœ์ž๋“ค์€ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•œ๋‹ค. ์ด ๋•Œ, ๋‹ค์‹œ complie, build, ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ํ†ตํ•ด ์ˆ˜์ •๋œ ์ฝ”๋“œ๊ฐ€ ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜๋Š”์ง€ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•ด..
Your local changes to the following files would be overwritten by merge, Please commit your changes or stash them before you merge UMC ํ™œ๋™ ์ค‘์—์„œ ์›๊ฒฉ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ์žˆ๋Š” ํŒŒ์ผ ๋‚ด์šฉ์„ ๊ฐ€์ ธ์˜ฌ ๋•Œ, ์ด์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. ์—ฌ๋Ÿฌ๊ฐ€์ง€ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ์žˆ์ง€๋งŒ. ๋‚˜๋Š” ์ด์™€ ๊ฐ™์€ ๋ช…๋ น์–ด๋กœ ์œ„ ์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐํ–ˆ๋‹ค. $ git stash ํŒŒ์ผ๋“ค ์ž„์‹œ์ €์žฅํ•œ ํ›„, ๋‹ค์‹œ git merge ์‹คํ–‰ํ•˜๋ฉด ๋˜๋Š” ๊ฒƒ์„ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ๋‹ค.
UMC์—์„œ ๐Ÿ’ป์•ฑ ๋Ÿฐ์นญ ํ”„๋กœ์ ํŠธ๐Ÿ’ป๋ฅผ ํ•œ์ฐฝ ์ง„ํ–‰ ์ค‘์ธ๋ฐ Git์„ ์ฒ˜์Œ์จ๋ด์„œ ์–ด๋ ค์›€์„ ๊ฒช๊ณ  ์žˆ๋Š” ์š”์ฆ˜์ด๋‹ค. ๐Ÿ˜ข ํŠนํžˆ, ์›๊ฒฉ ์ €์žฅ์†Œ์— pull request ํ›„ merge ๋œ ํŒŒ์ผ์„ ๋‹ค์‹œ ๋‚ด ๋กœ์ปฌ ์ €์žฅ์†Œ์— ๋ถˆ๋Ÿฌ์˜ค๋ ค๋‹ค๊ฐ€ ์ง€๋‚œ๋ฒˆ ์—๋Ÿฌ๊ฐ€ ๋‚˜๊ณ  ๋‹ค์‹œ ์ฒ˜์Œ fork ๋ถ€ํ„ฐ ์ง„ํ–‰ํ–ˆ๋˜ ๋ถˆ์ƒ์‚ฌ๊ฐ€ ์žˆ์—ˆ๋‹ค. 1. git remote git remote -v ๋ฅผ ํ†ตํ•ด ์›๊ฒฉ ์ €์žฅ์†Œ๊ฐ€ ์ €์žฅ ๋˜์–ด ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•œ ์‚ฌ๋žŒ์€ ์ด ๊ณผ์ •์„ ๊ฑด๋„ˆ ๋›ฐ์–ด๋„ ๋œ๋‹ค. upstream ์˜ ๊ฒฝ์šฐ์—๋Š” ์ž์‹ ์ด ์›ํ•˜๋Š” ์ด๋ฆ„์œผ๋กœ ์ €์žฅ ๊ฐ€๋Šฅํ•˜๋‹ค. ํ•„์ˆ˜์ ์ธ ์ด๋ฆ„์ด ์•„๋‹ˆ๋‹ค. $ git remote add upstream [git clone ์ฃผ์†Œ] $ git remote -v 2. git fetch $ git fetch upstream main //upstream : ์ž..
๐Ÿ–ŠGitHub์— ๋ณ€๊ฒฝํ•œ ํŒŒ์ผ์„ ์—…๋กœ๋“œ ํ•˜๋Š” ๋ฐฉ๋ฒ• git add . git commit -m "์›ํ•˜๋Š” ๋‚ด์šฉ commit" git push origin [branch ๋‚ด์šฉ] ๋…ผ์™ธ๋กœ, GitHub์— ์ฒซ ํŒŒ์ผ ์—…๋กœ๋“œํ•˜๋Š” ๊ฒƒ์€ GitHub ํŒŒ์ผ ์ƒ์„ฑ์‹œ, ์ฒซ ํ™”๋ฉด ๋”ฐ๋ผํ•˜๋ฉด ๋‚˜์˜จ๋‹ค.
๊ฐ์ฒด์ง€ํ–ฅ์ ์–ธ์–ด์™€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ˆ˜์—…์œผ๋กœ backend frontend ํŒŒ์ผ์„ ์˜ฌ๋ฆฌ๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ ๊ฐ‘์ž๊ธฐ ์ด์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€,,,,, error: failed to push some refs to 'https://github.com/~~~/***.git' [ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•] branch๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ์ด๊ธฐ ๋•Œ๋ฌธ์— 'branch๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค. -> ๋‚˜๋Š” ์ด๋žฌ๋Š”๋ฐ, ์›๊ฒฉ์ €์žฅ์†Œ๋ž‘ ๋กœ์ปฌ์ €์žฅ์†Œ๊ฐ€ ๋‹ค๋ฅธ ๊ฒฝ์šฐ์—๋„ ๊ทธ๋Ÿด ์ˆ˜๊ฐ€ ์žˆ๋‹ค๊ณ  ํ•จ. ( git pull -> git push ํ•˜๋ฉด ํ•ด๊ฒฐ ์™„๋ฃŒ) //1๋ฒˆ $ git branch -m main //2๋ฒˆ $ git push -u origin main git ํŒŒ์ผ ์ถ”๊ฐ€ ์™„๋ฃŒ!! [์ถœ์ฒ˜] https://iancoding.tistory.com/240
GitHub์— "์ ˆ์ฐจ์ ์‚ฌ๊ณ ์™€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ" ์ˆ˜๊ฐ•์‹ ์ฒญ ํ”„๋กœ๊ทธ๋žจ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŒŒ์ผ์„ GitHub์— ์—ฐ๋™ํ•˜๋ ค๊ณ ํ•˜๋Š”๋ฐ ์ด์™€ ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. 1. git@github.com: permission denied (publickey). fatal: could not read from remote repository 2. //git remote add origin https://github.com/**/**.git ๋ช…๋ น์–ด ์‚ฌ์šฉ์‹œ fatal: remote origin already exists. ์ด์™€ ๊ฐ™์€ ๋ฌธ์ œ์— ๋Œ€ํ•œ ํ•ด๊ฒฐ์ฑ…์„ ์ ๊ณ ์žํ•œ๋‹ค. 1. git@github.com: permission denied (publickey). fatal: could not read from remote repository CMD ..
chaerlo127
'DevOps' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก